Public Sub HideRows()
Dim r As Range
Dim lLastRow As Long
lLastRow = Range("P" & Rows.Count).End(xlUp).Row
For i = 1 To lLastRow
If Range("P" & i).Value > 0 Then
If r Is Nothing Then
Set r = Range("P" & i)
Else
Set r = Union(r, Range("P" & i))
End If
End If
Next i
If Not r Is Nothing Then r.EntireRow.Hidden = True
End Sub
Public Sub HideRows()
Dim r As Long, lr As Long
lr = Cells(Rows.Count, "P").End(xlUp).Row
For i = lr To 1 Step -1
If Range("P" & i).Value >= 0 Then
Rows(i).EntireRow.Hidden = True
End If
Next i
End Sub
Sorry, I didn't understand. Does it mean:Ahh brilliant, thanks very much. But one more thing... IF I wanted to do it when cell = 0 how would I ensure that the cells without a sum in there are not hidden?
Would it be better to go with a "true" criteria instead?
Sorry, I still need the criteria sum=0 to be the reason why the row is hidden!!
Public Sub HideRows()
Dim i As Integer
For i = 31 To 13 Step -1
If Range("P" & i).Value >= 0 Then
Rows(i).EntireRow.Hidden = True
End If
Next i
End Sub