Two (2) Combobox Linked Together

NelsonX

New Member
Joined
Feb 23, 2008
Messages
29
Hi, I've created two comboboxes (from the control toolbar) and linked them to the same named range (list) as well as the same named range (LinkedCell). The comboboxes are on different sheets.

I've noticed when I use one of the comboboxes the linked cell changes value (as expected), but the other combobox is not updated to this view.

Is there a way to make sure both comboboxes reflect the same value when one is changed?

thanks

Nelson
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Hi In sheet(1) Combobox you could have the code:-
Code:
Private [COLOR="Navy"]Sub[/COLOR] ComboBox1_Change()
[COLOR="Navy"]With[/COLOR] Sheets("sheet2").ComboBox1
.value = ComboBox1.List(ComboBox1.ListIndex)
[COLOR="Navy"]End[/COLOR] With
[COLOR="Navy"]End[/COLOR] [COLOR="Navy"]Sub[/COLOR]
and in sheet (2)
Code:
[COLOR="Navy"]Sub[/COLOR] MG05Oct09
Private [COLOR="Navy"]Sub[/COLOR] ComboBox1_Change()
[COLOR="Navy"]With[/COLOR] Sheets("sheet1").ComboBox1
.value = ComboBox1.List(ComboBox1.ListIndex)
[COLOR="Navy"]End[/COLOR] With
[COLOR="Navy"]End[/COLOR] [COLOR="Navy"]Sub[/COLOR]
Regards Mick
 
Upvote 0
Hi Mick, I can't get that code to work. I have excel 2003 SP3.

So in sheet 1 the combobox should refer to the sheet2 listindex and vice versa right?

thanks

Nelson
 
Upvote 0
Hi, You need to remove the "Sub bit" at the beginning of the second bit of code. (My mistake,Added in error).
Both codes should go in the combobox Change Events.
Double click the combobox in "Design mode" this will automaically open the VB Editor in the Combobox change event, so you'll have remove the duplicate "Private Sub ComboBox1_Change()"
bit from the code.
Regards Mick
 
Upvote 0

Forum statistics

Threads
1,222,561
Messages
6,166,802
Members
452,073
Latest member
akinch

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