View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Dominik Petri Dominik Petri is offline
external usenet poster
 
Posts: 15
Default Hide Next row based on Cell Value

If you want VBA instead of AdvancedFilter, no loop necessary:

With Range("C5:C100")
..Rows.Hidden=False ' Show all
..SpecialCells(xlCellTypeBlanks).EntireRow.Hidden= true ' hide rows when
cell is blank
End With


Regards,
Dominik.



Jacob Skaria schrieb:
Use a loop.The below works from 5 to 100

Dim lngRow As Long

Application.ScreenUpdating = False
For lngRow = 5 To 100
If Range("C" & lngRow).Value = "" Then
Rows(lngRow + 1).Hidden = True
Else
Rows(lngRow + 1).Hidden = False
End If
Next
Application.ScreenUpdating = False