Sub hidden()
If Range("K5").Value = 1 Then
Rows("15").hidden = True
Rows("19").hidden = True
End If
If Range("K6").Value = 2 Then
Rows("16").hidden = True
Rows("20").hidden = True
End If
End Sub
Sub test()
Rows(15).Hidden = Range("K5") = 1
Rows(19).Hidden = Range("K5") = 1
Rows(16).Hidden = Range("K6") = 2
Rows(20).Hidden = Range("K6") = 2
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
Dim d As Range
Set d = Intersect(Target, Range("K5:K6"))
If d Is Nothing Then Exit Sub
Application.EnableEvents = False
Rows(15).Hidden = Range("K5") = 1
Rows(19).Hidden = Range("K5") = 1
Rows(16).Hidden = Range("K6") = 2
Rows(20).Hidden = Range("K6") = 2
Application.EnableEvents = True
End Sub