View Single Post
 
Old 02-14-2018, 07:34 AM
LearnerExcel LearnerExcel is offline Windows 7 32bit Office 2013
Advanced Beginner
 
Join Date: Nov 2016
Posts: 82
LearnerExcel will become famous soon enoughLearnerExcel will become famous soon enough
Default Is there any way to modify the folloiwng code so that it will hide the empty cells ..

Is there any way to modify the folloiwng code so that it will hide the empty cells with formula (as the following code does) and in additon to that it should filter data based on Cell G5 value?

Code:
 
Sub HideRowsMissingData()
Dim cl As Range, i As Integer
        
Application.ScreenUpdating = False
With Sheets("Sheet1")
    For Each cl In .Range("A4:A502")
        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
Reply With Quote