View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Rowan Drummond[_3_] Rowan Drummond[_3_] is offline
external usenet poster
 
Posts: 414
Default Linking combo boxes

If you are going to always have the same value in each combobox then why
not drive all three pivottables off a single combobox?

Anyway, assuming the comboboxes are from the Controls Toolbox and are on
the same sheet then:

Private Sub ComboBox1_Change()
On Error GoTo ErrorHandler
Application.EnableEvents = False
Me.ComboBox2.Value = Me.ComboBox1.Value
Me.ComboBox3.Value = Me.ComboBox1.Value
ErrorHandler:
Application.EnableEvents = True
End Sub

Private Sub ComboBox2_Change()
On Error GoTo ErrorHandler
Application.EnableEvents = False
Me.ComboBox1.Value = Me.ComboBox2.Value
Me.ComboBox3.Value = Me.ComboBox2.Value
ErrorHandler:
Application.EnableEvents = True
End Sub

Private Sub ComboBox3_Change()
On Error GoTo ErrorHandler
Application.EnableEvents = False
Me.ComboBox1.Value = Me.ComboBox3.Value
Me.ComboBox2.Value = Me.ComboBox3.Value
ErrorHandler:
Application.EnableEvents = True
End Sub

Hope this helps
Rowan

Extreem wrote:
Hello,

I have a spreadsheet that contains 3 combo boxes which drive pivot tables.
Is there a way to syncronize all 3 pulldowns when the value of one changes.
The intent is to have all 3 pivot tables (vendors) match upon a change in any
of the pulldown boxes.

Any help is appreciated.

Thank You,
Extreem