View Single Post
 
Old 02-12-2018, 05:10 PM
NoSparks NoSparks is offline Windows 7 64bit Office 2010 64bit
Excel Hobbyist
 
Join Date: Nov 2013
Location: British Columbia, Canada
Posts: 842
NoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of light
Default

If any cell within your data area is blank, this will hide that row.
Code:
Sub HideRowsMissingData()

    Dim cl As Range, i As Integer
        
Application.ScreenUpdating = False
With Sheets("AutoFill")
    For Each cl In .Range("B6:B500")
        If cl.Value = "" Then
            .Rows(cl.Row).Hidden = True
        Else
            For i = 1 To 4
                If cl.Offset(, i).Value = "" Then
                    .Rows(cl.Row).Hidden = True
                    Exit For
                End If
            Next i
        End If
    Next cl
End With
Application.ScreenUpdating = True
End Sub
and this will un-hide all hidden rows
Code:
Sub UnHideRows()
Sheets("AutoFill").Rows.EntireRow.Hidden = False
End Sub
Reply With Quote