Is it possible to combine the below? basically need to hide different rows if cells C7, C8, C9 & C10 have yes or no.
VBA Code:
Sub Monitor()
Range("A111:A142").EntireRow.Hidden = False
End Sub
Sub Monitor1()
Range("A111:A142").EntireRow.Hidden = True
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
Set Target = Range("C7")
If Target.Value = "Yes" Then
Call Monitor
End If
If Target.Value = "No" Then
Call Monitor1
End If
End Sub
Sub Lock()
Range("A143:A145").EntireRow.Hidden = False
End Sub
Sub Lock1()
Range("A143:A145").EntireRow.Hidden = True
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
Set Target = Range("C8")
If Target.Value = "Yes" Then
Call Lock
End If
If Target.Value = "No" Then
Call Lock1
End If
End Sub
Sub Rail()
Range("A146:A152").EntireRow.Hidden = False
End Sub
Sub Rail1()
Range("A146:A152").EntireRow.Hidden = True
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
Set Target = Range("C9")
If Target.Value = "Yes" Then
Call Rail
End If
If Target.Value = "No" Then
Call Rail1
End If
End Sub
Sub Vehl()
Range("A153:A159").EntireRow.Hidden = False
End Sub
Sub Veh1()
Range("A153:A159").EntireRow.Hidden = True
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
Set Target = Range("C10")
If Target.Value = "Yes" Then
Call Veh
End If
If Target.Value = "No" Then
Call Veh1
End If
End Sub
Last edited by a moderator: