View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Pete[_7_] Pete[_7_] is offline
external usenet poster
 
Posts: 13
Default Want only rows with populated data

Found this in one of the forums. Does the trick.
Pete
'
Sub HideRows()
Application.ScreenUpdating = False
Dim i As Integer
Dim RStart As Range
Dim REnd As Range
Set RStart = Range("G3")
Set REnd = Sheets("Presentation").Range("g65536").End(xlUp).O ffset(0,
3)
Range(RStart, REnd).Select
On Error Resume Next
With Selection
..EntireRow.Hidden = False
For i = 1 To .Rows.Count
If WorksheetFunction.CountBlank(.Rows(i)) = 4 Then
..Rows(i).EntireRow.Hidden = True
End If
Next i
End With
Set RStart = Nothing
Set REnd = Nothing
Range("A1").Select
Application.ScreenUpdating = True
End Sub