I have code that runs 4 macros to hide and unhide sheets when the value of a cell changes. I have it set up so that when a user selects a value from the listbox a formula in a hidden cell changes to either a 1 or 0 depending on the value selected. The problem is unless I manually click on the formula cell the code doesn't run. How can I automate it so that my code recognizes the value in the cell changed without having to double click it?
Here is the code I am using:
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Cells.Count > 1 Then Exit Sub
If IsNumeric(Target) And Target.Address = "$A$20" Then
Select Case Target.Value
Case Is = 0
Run "ShowAdminSheets"
Run "HideUserSheets"
Case Is = 1
Run "HideAdminSheets"
Run "ShowUserSheets"
End Select
End If
End Sub
Here is the code I am using:
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Cells.Count > 1 Then Exit Sub
If IsNumeric(Target) And Target.Address = "$A$20" Then
Select Case Target.Value
Case Is = 0
Run "ShowAdminSheets"
Run "HideUserSheets"
Case Is = 1
Run "HideAdminSheets"
Run "ShowUserSheets"
End Select
End If
End Sub