update all comboboxes when anyother changes

B

bgeier

I am creating a userform where a user will enter a value in combobox (o
textbox). I want to have the rest of the combo boxes on the form (abou
13 of them) to update to the correct value corresponding to combobox1 (
am using a closed workbook to populate the comboboxes).

For example if a user enters (or selects via a dropdown) 001 i
combobox1 the data in combobox2 would change to "Company 1"; combobox
would change to "Attn: John Doe"; combobox4 would change to "You
Town"; etc.

It also has to allow the user to change any other combobox withou
affecting the values in the rest of the comboboxes.

The data from the userform will be used to print a form and to create
sheet to be used as a history of all transactions.

Thank-you in advance for your assistance.
 
M

Mark Rosenkrantz

bgeirer;

You would need something like this.

Private Sub Combobox1_Change()
' Get the currently selected item
Select Case ComboBox1.Value
' If North Carolina, set List property of ListBox2 to Column B.
Case "North Carolina"
ListBox2.List = Worksheets("Data").Range("C4:C7").Value
' If South Carolina, set List property of ListBox2 to Column C.
Case "South Carolina"
ListBox2.List = Worksheets("Data").Range("D4:D7").Value
' If Virginia, set List property of ListBox2 to Column D.
Case "Virginia"
ListBox2.List = Worksheets("Data").Range("E4:E7").Value
End Select
ListBox2.ListIndex = 0
End Sub


This updates one (1) listbox from another listbox, but can also used for
comboboxes.

Mark.

--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top