using one combo box to auto fill others!

draccus

New Member
Joined
Nov 30, 2016
Messages
5
Hi

Sorry if this question has already been asked I've spent several hours searching and not found what i need.

I'm looking for the vba code to use to auto fill other combo boxes when the correct data is selected in one of the other combo boxes on a userform.

this is what i would like to acheive
I have 4 combo boxes;
  • if i select a2 in combo box 1 i would like combo box2 to autofill with b2, combo box3 to autofill with c2 and combo box4 to autofill with d2
  • if i select b2 in combo box 2 i would like combo box1 to autofill with a2, combo box3 to autofill with c2 and combo box4 to autofill with d2
  • if i select c2 in combo box 3 i would like combo box1 to autofill with a2, combo box2 to autofill with b2 and combo box4 to autofill with d2
  • if i select d2 in combo box 4 i would like combo box1 to autofill with a2, combo box2 to autofill with b2 and combo box3 to autofill with c2

Column A on the worksheet is a named range (ContactName) (A2-A1000)
Column B on the worksheet is a named range (ContactID) (B2-B1000)
Column C on the worksheet is a named range (ContactDepartment) (C2-C1000)
Column C on the worksheet is a named range (ContactEmail) (D2-D1000)

Any help would be greatly appreciated!!

Thank you
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Set the ListIndex value of the comboboxes, here's an example for one:

Code:
Private Sub ComboBox1_Change()


ComboBox2.ListIndex = ComboBox1.ListIndex
ComboBox3.ListIndex = ComboBox1.ListIndex
ComboBox4.ListIndex = ComboBox1.ListIndex


End Sub
 
Upvote 0

Forum statistics

Threads
1,223,164
Messages
6,170,444
Members
452,326
Latest member
johnshaji

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