VBA code need to update all vabs and dependent combo boxes when combobox changes

neilcsmith1984

New Member
Joined
May 25, 2020
Messages
14
Office Version
  1. 2013
Platform
  1. Windows
Hi All,

I have 3 dependant activex combo box with a list changes depending on the selection of another active x combo box.

When the initial combo box changes the dependant combo boxes do not update unless I click on them. I also have a vba code linked to cell A1 that should auto update when the initial combo box changes.

Is there a code to get the combo boxes and vba code to update once the 1st combo box changes

Thanks
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
This is the code that runs of cell A1.

Cell A1 is based on a formula and I would like the VBA code to run every time the formula chnages the value in A1

If Target.Address = "$A$99" Then
If Target.Value = 1 Then Rows("102:119").EntireRow.Hidden = True
If Target.Value = 2 Then Rows("103:119").EntireRow.Hidden = True
If Target.Value = 2 Then Rows("101:102").EntireRow.Hidden = False
If Target.Value = 3 Then Rows("104:119").EntireRow.Hidden = True
If Target.Value = 3 Then Rows("101:103").EntireRow.Hidden = False
If Target.Value = 4 Then Rows("105:119").EntireRow.Hidden = True
If Target.Value = 4 Then Rows("101:104").EntireRow.Hidden = False
If Target.Value = 5 Then Rows("106:119").EntireRow.Hidden = True
If Target.Value = 5 Then Rows("101:105").EntireRow.Hidden = False
If Target.Value = 6 Then Rows("107:119").EntireRow.Hidden = True
If Target.Value = 6 Then Rows("101:106").EntireRow.Hidden = False
If Target.Value = 7 Then Rows("108:119").EntireRow.Hidden = True
If Target.Value = 7 Then Rows("101:107").EntireRow.Hidden = False
If Target.Value = 8 Then Rows("109:119").EntireRow.Hidden = True
If Target.Value = 8 Then Rows("101:108").EntireRow.Hidden = False
If Target.Value = 9 Then Rows("110:119").EntireRow.Hidden = True
If Target.Value = 9 Then Rows("101:109").EntireRow.Hidden = False
If Target.Value = 10 Then Rows("111:119").EntireRow.Hidden = True
If Target.Value = 10 Then Rows("101:110").EntireRow.Hidden = False
If Target.Value = 11 Then Rows("112:119").EntireRow.Hidden = True
If Target.Value = 11 Then Rows("101:111").EntireRow.Hidden = False
If Target.Value = 12 Then Rows("113:119").EntireRow.Hidden = True
If Target.Value = 12 Then Rows("101:112").EntireRow.Hidden = False
If Target.Value = 13 Then Rows("114:119").EntireRow.Hidden = True
If Target.Value = 13 Then Rows("101:113").EntireRow.Hidden = False
If Target.Value = 14 Then Rows("115:119").EntireRow.Hidden = True
If Target.Value = 14 Then Rows("101:114").EntireRow.Hidden = False
If Target.Value = 15 Then Rows("116:119").EntireRow.Hidden = True
If Target.Value = 15 Then Rows("101:115").EntireRow.Hidden = False
If Target.Value = 16 Then Rows("117:119").EntireRow.Hidden = True
If Target.Value = 16 Then Rows("101:116").EntireRow.Hidden = False
If Target.Value = 17 Then Rows("118:119").EntireRow.Hidden = True
If Target.Value = 17 Then Rows("101:1117").EntireRow.Hidden = False
If Target.Value = 18 Then Rows("119:119").EntireRow.Hidden = True
If Target.Value = 18 Then Rows("101:118").EntireRow.Hidden = False
If Target.Value > 18 Then Rows("102:119").EntireRow.Hidden = False
End If
End Sub
 
Upvote 0

Forum statistics

Threads
1,215,046
Messages
6,122,855
Members
449,096
Latest member
Erald

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