How to link or pair individual values in two different combo box in a user form using VBA code??

s ganesh

New Member
Joined
Aug 10, 2014
Messages
4
Dear Experts,

I am struck up here again. I thought some one else may have the same requirement so Im posting here for your help.I am using Excel 2007. I have a user form to create a data base of values. There are 4 combo boxes in my user form.

Situation:

Let us consider them as Combobox1 to combobox4. Combo box1 and 2 are in a frame and combo box3 and 4 are in a frame in the same user form.

I have a sheet where the named ranges are entered to generate a dropdown list when the combo box is accessed. There are 4 different lists as the named ranges. I have option button before moving to the first combo box. When option 1 is selected the first two named ranges show up in Combo box 1 and 2 each respectively. When option 2 is selected the named 3 and 4 show up in combo box 1 and 2 respectively. The same thing happens with 3 and 4. Both are connected to the same named ranges like combo box 1 and 2.

What I need:

When a value in combo box 1 is chosen after making the preselection with option button, a corresponding value should be automatically entered in the combo box2. But it should be editable with the drop down list.
I guess it is like pairing or linking individual values in the two lists so that when a value is chosen in combo box 1 , combo box 2 automatically selects the corresponding value but for exceptional cases it should editable also.

Please refer to the link below for screen shot.It should make things clear.

https://drive.google.com/file/d/0B3bYjYnQsgt2MEJfUGZNOWFvU28/edit?usp=sharing

https://drive.google.com/file/d/0B3bYjYnQsgt2eFNpS1VUV0wyMzA/edit?usp=sharing

Is there any code for this function which I can add to the existing vba??
If so please let me know how to do the same.:)


Thanks in advance.

Gans
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.

Forum statistics

Threads
1,214,667
Messages
6,120,810
Members
448,990
Latest member
rohitsomani

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