Houstons_Time
New Member
- Joined
- Sep 6, 2007
- Messages
- 13
Can some one help me with a macro - Where I hide the entire row if that PARTICULAR ROW contains NO DATA or NUMBER.
Sub HideBlankRows()
Dim LastRow As Long, I As Long
LastRow = Cells(Rows.Count, 1).End(xlUp).Row
Application.ScreenUpdating = False
For I = 1 To LastRow
If WorksheetFunction.CountA(Rows(I)) = 0 Then Rows(I).EntireRow.Hidden = True
Next I
Application.ScreenUpdating = True
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count > 1 Then Exit Sub
Dim ThisRow As Long
ThisRow = Target.Row
Sheets("Master").Rows(ThisRow).Hidden = _
Application.WorksheetFunction.CountA(Rows(ThisRow).EntireRow) = 0
End Sub