Hi there, I am trying to write a VBA to hide and entire row if any of the cells in four columns ( E,H,K and N) greater than -1 and small than 1. I have written the following code:
I am getting error message 1004: "Unable to set the hidden property of the range class. Any help would be greatly appreciated!
Code:
Sub Report()
Dim i As Integer
Dim Rows As Long
For i = 7 To 37
If Cells(i, 5) > -1 < 1 And Cells(i, 8) > -1 < 1 And Cells(i, 11) > -1 < 1 And Cells(i, 14) > -1 < 1 Then
ActiveCell.EntireRow.Select
Selection.Hidden = True
End If
Next i
End Sub