Hi, for some reason this will not run. I have tried multiple time to hide and unhide based on cell value. Any help would be greatly appreciated!
Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Range("C5"), Target) Is Nothing Then
Application.EnableEvents = False
Me.Unprotect Password:="secret"
Range("A6:A22").EntireRow.Hidden = True
Select Case Range("C5").Value
Case "Annual Salary"
Range("A7").EntireRow.Hidden = False
Case "Hourly Wage"
Range("A16").EntireRow.Hidden = False
End Select
Me.Protect Password:="secret"
Application.EnableEvents = True
End If
End Sub
Sub Test(ByVal Target As Range)
If Not Intersect(Range("C5"), Target) Is Nothing Then
Application.EnableEvents = False
Range("6:22").EntireRow.Hidden = True
Select Case Range("c5").Value
Case "Annual Salary"
Range("a7").EntireRow.Hidden = False
Case "Hourly Range"
Range("a16").EntireRow.Hidden = False
End Select
Application.EnableEvents = True
End If
End Sub
I am trying to hide/unhide rows based on c5. then based on the result of c5 if c7 unhidden and value select on hide either row c10:c12 or c8:c9.
Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Range("C5"), Target) Is Nothing Then
Application.EnableEvents = False
Me.Unprotect Password:="secret"
Range("A6:A22").EntireRow.Hidden = True
Select Case Range("C5").Value
Case "Annual Salary"
Range("A7").EntireRow.Hidden = False
Case "Hourly Wage"
Range("A16").EntireRow.Hidden = False
End Select
Me.Protect Password:="secret"
Application.EnableEvents = True
End If
End Sub
Sub Test(ByVal Target As Range)
If Not Intersect(Range("C5"), Target) Is Nothing Then
Application.EnableEvents = False
Range("6:22").EntireRow.Hidden = True
Select Case Range("c5").Value
Case "Annual Salary"
Range("a7").EntireRow.Hidden = False
Case "Hourly Range"
Range("a16").EntireRow.Hidden = False
End Select
Application.EnableEvents = True
End If
End Sub
I am trying to hide/unhide rows based on c5. then based on the result of c5 if c7 unhidden and value select on hide either row c10:c12 or c8:c9.