Any VB Experts Out There?

Status
Not open for further replies.

vburns01

Board Regular
Joined
Jan 1, 2003
Messages
60
I need a favor from someone. Can anyone contrust a code for me that allows one combo box (lets call it ComboBox2) to be dependent on the selection of another combo box (call that ComboBox1)? I have 12 topics that i have in ComboBox1, and each topics has from about 10-2500 subtopics. It would be great to link them by the combo boxes.

I have already set one up with data-->validation-->list, and it didnt work as good as i wanted. So if anyone can help me please feel free.

Thanks
 
This code would do that:

Code:
Private Sub ComboBox2_Change()
    Sheets("Sheet1").Range("AA1").Value = ComboBox2.Value
End Sub

Change the name of the worksheet to suit.
 
Upvote 0

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
Dear Andrew,

I dont think that it works. I have a good idea, why dont you send me something that you did in my email:

vincent.burns@villanova.edu

I know you keep trying to help me but its not working. Why dont you send me something and then ill figure it out from there.

Peace
 
Upvote 0
On 2003-01-09 09:57, vburns01 wrote:
I have done something like before and it hasnt helped. I am working in a Structural Engineering Firm. The first combo box has a list of different steel beams shapes (like W, T, S, etc), and the second box has the different sizes of each shape (example - W44x35, W44x29, etc.) The problem i now propose to you true believers, is the fact that after the user has made a selection in the second box, all these characteristics pop up below them on the same sheet. All these above data are in a chart that looks like this:

Type Shape Dia Wt Area Wedge Shear..
---- ----- -- -- ---- ----- -----
W W44x35 44in 353lb 98in3 2.5 136lb-f
W w44x29 39in 339lb 82in3 2.1 129lb-f

...and this continues on for 102 columns and 1924 rows of data.
{snip}
Use a PivotTable. It is ideal for what you want, especially, if all the other columns contain numeric data. The column that would have been combobox1 should be a page field. The column that would be combobox2 should be a row field. Set each of the other fields as a data field. Since a PT insists on aggregating data, select the MAX function.
 
Upvote 0
Thanks Buddy,

But your too late and wrong. I already got the code for anyone who is wondering what it is here ya go -

Private Sub ComboBox1_Change()
Dim choice1 = As String
choice1 = ComboBox1.Value
ComboBox2.ListFullRange = choice1
End Sub

Make sure that it is in the CONTROL combo-box and not in the FORMS combo-box (I already did that so far).

Thanks everyone for your help and Ill see y'all later.

One

P.S. Remember if you see me on the ballot in 25 years, holla at me with your vote.
 
Upvote 0
Vin,

But your too late and wrong.

Maybe the former, but not necessarily the latter.

Private Sub ComboBox1_Change()
Dim choice1 = As String
choice1 = ComboBox1.Value
ComboBox2.ListFullRange = choice1
End Sub


Please read the following again:

http://www.mrexcel.com/board/viewtopic.php?topic=35260&forum=2

Two important things to note in my posting. First and most importantly, please chill out, Tushar's trying to tell you something that's reasonable and helpful. Second, Fill vs. Full, the code you posted above is destined to bomb.

_________________
Cheers,<font size=+2><font color="red"> Nate<font color="blue"> Oliver</font></font></font>
This message was edited by NateO on 2003-01-09 17:07
 
Upvote 0
On 2003-01-09 16:29, vburns01 wrote:
Thanks Buddy,

But your too late and wrong. I already got the code for anyone who is wondering what it is here ya go -
{snip}
Code from *you*? You've got to be kidding. Just keep in mind that, unless otherwise indicated, I *test* my suggestions. So, I *know* the PT idea works!


_________________
Regards,

Tushar
www.tushar-mehta.com
This message was edited by tusharm on 2003-01-09 17:26
 
Upvote 0
All right please let go any bad feelings. People I was just excited that the project was finally finished. I didnt mean to make anyone cry. Please forgive me.
 
Upvote 0
Howdy Vinny,

On 2003-01-10 08:42, vburns01 wrote:
Hey NatO,

By the way, I didnt get that code from you, or even from here. I got it from:

http://www.visualbasicforum.com/

So if anyone is looking for a site with excellent programmers, go there.

You're joking right? Other than the fact that it doesn't work, it almost looks the functional variety I gave you yesterday just before you posted that stuff that looks like code.

Cheers,
North Atlantic Treaty Organization
 
Upvote 0
Status
Not open for further replies.

Forum statistics

Threads
1,224,591
Messages
6,179,768
Members
452,940
Latest member
rootytrip

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top