View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Jarek Kujawa[_2_] Jarek Kujawa[_2_] is offline
external usenet poster
 
Posts: 896
Default Macro to hide rows based on criteria

Mike is right
an empty cell will been as '0', so I have to adjust my macro

Sub hideeeee()
On Error Resume Next
For Each cell In Selection
If IsNumeric(cell) And cell.Offset(0, 4) = 0 And cell.Offset(0, 5) = 0
_
And Len(cell.Offset(0, 4)) 0 And Len(cell.Offset(0, 5) 0 Then
cell.Rows.EntireRow.Hidden = True
End If
Next cell

End Sub

sorry