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
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
I set up a worksheet like this:
BOOK15
ABCD
1ListList1List2
21AD
32BE
4CF
5
6
7
8
9
10
Sheet1


The titles in row 1 are the names of the ranges below.

Then I created a UserForm and added 2 ComboBoxes. I assigned List as the RowSource for ComboBox1.

Then I wrote this code to synchronise the RowSource for ComboBox2:

Code:
Private Sub ComboBox1_Change()
    ComboBox2.RowSource = "List" & ComboBox1.ListIndex + 1
    ComboBox2.ListIndex = -1
End Sub
 
Upvote 0
this is similar to my problem can someone post a code, my post is called combo box question.
 
Upvote 0
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.

The way my sheet is set-up now is, I have my data-->validation boxes set-up so when you pick the second one (in C7) the names of each of the characteristics is revealed using the =INDEX(dia,c7). This works perfectly fine.

I wanted to have the combo boxes do that now, so if that makes the codes different or whatever can you please.

I also need to know where to put the code and how to activate it.

Thanks again
 
Upvote 0
What do you want to do if the user selects something from ComboBox1 or ComboBox2? Put the selection in a cell? If so which cell(s)?
 
Upvote 0
What I want is when something is selected from combobox1 (say names of teams) i want combobox2 to have information specific to the choice in combobox1 (say names of the players on the teams). and when they choose the choice in combobox2, i want information to appear in the cells (say the players statistics for the season). so what i really wish would happen is that somehow i can treat the combobox2 as a cell and just reference the box in a formula as you woul do in a cell.
 
Upvote 0
On 2003-01-09 11:12, vburns01 wrote:
What I want is when something is selected from combobox1 (say names of teams) i want combobox2 to have information specific to the choice in combobox1 (say names of the players on the teams). and when they choose the choice in combobox2, i want information to appear in the cells (say the players statistics for the season). so what i really wish would happen is that somehow i can treat the combobox2 as a cell and just reference the box in a formula as you woul do in a cell.

So in which cell would you like to put the information from ComboBox2?
 
Upvote 0
Status
Not open for further replies.

Forum statistics

Threads
1,224,590
Messages
6,179,752
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