I want to hide the entire rows 8 to 32 in my worksheet if cell K22 contains "true" and if not I want them to be shown.
If anyone could help that would be great!
Heres what I've tried.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Range("K22").Value = "True" Then
Rows("8:32").EntireRow.Hidden = False
Else
Rows("8:32").EntireRow.Hidden = True
End If
End Sub
try
Private Sub Worksheet_Change(ByVal Target As Range)
Rows("8:32").EntireRow.Hidden = IIf(UCase(Range("K22")) = "TRUE", True, False)
End Sub
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.