Dependent Data Validation List & ByVal Sub

crburke92

Board Regular
Joined
Feb 5, 2019
Messages
71
Hey all,

I have a Data Validation list on one of my sheets in Cell B1 that drives a ByVal Sub:

VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)

If Range("B1").Value = "All" Then
Range("ALL").EntireColumn.Hidden = False
    ElseIf Range("B1") = "HV Breakers" Then
        Range("ALL").EntireColumn.Hidden = True
        Range("HVBREAKERS").EntireColumn.Hidden = False
    ElseIf Range("B1") = "HV Breaker W/ Timing" Then
        Range("ALL").EntireColumn.Hidden = True
        Range("HVBREAKERWTIMING").EntireColumn.Hidden = False
    ElseIf Range("B1") = "LV Breakers" Then
        Range("ALL").EntireColumn.Hidden = True
        Range("LVBREAKER").EntireColumn.Hidden = False
        End If
End Sub

This was working fine until I hit the character limit for my list (Just a portion of code, actually much longer). When I changed my list formula to =SheetList!$A$1:$A$24 to allow for a longer list, my sheet stopped updating. Any fix for this?
 
Glad you sorted it & thanks for the feedback.
 
Upvote 0

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December

Forum statistics

Threads
1,215,067
Messages
6,122,949
Members
449,095
Latest member
nmaske

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