radsok8199
New Member
- Joined
- Dec 4, 2020
- Messages
- 24
- Office Version
- 2016
- Platform
- Windows
- MacOS
- Mobile
Dear VBA Masters
I want below code to check range and If any row contains value FALSE then EntireRow.Hidden = False , else I want rest of rows to be hidden.
Seems simple but it does not work the way I want. Below code shows only 2 rows from below example. Why ?
I want below code to check range and If any row contains value FALSE then EntireRow.Hidden = False , else I want rest of rows to be hidden.
Seems simple but it does not work the way I want. Below code shows only 2 rows from below example. Why ?
VBA Code:
Sub ShowFalseOnly()
Dim Cell As Range
For Each Cell In ActiveSheet.Range("A1:F14")
If IsError(Cell.Value) Then
Cell.EntireRow.Hidden = True
ElseIf Cell.Value = True Then
Cell.EntireRow.Hidden = True
ElseIf Cell.Value = False Then
Cell.EntireRow.Hidden = False
End If
Next Cell
End Sub
Last edited: