Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #11  
Old 02-14-2018, 07:34 AM
LearnerExcel LearnerExcel is offline How to modify code for Auto filter based on two criteria ... Windows 7 32bit How to modify code for Auto filter based on two criteria ... Office 2013
Advanced Beginner
How to modify code for Auto filter based on two criteria ...
 
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
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to modify code for Auto filter based on two criteria ... Sum based on multiple criteria (one of the criteria is not unique) until a threshold is reached. phillipsdp Excel 1 11-09-2016 12:53 AM
How to modify code for Auto filter based on two criteria ... Filter Mail Merge based on a list of filter criteria AusSteelMan Mail Merge 2 05-09-2016 03:35 PM
Auto fill drops down using VBA code based on selection AgilityJS Word VBA 5 11-03-2015 07:50 PM
Forgotten Sort and Filter Criteria rbdmg Mail Merge 0 10-31-2011 09:14 PM
Modify vba code to print based on name in the InputBox OTPM Project 0 05-25-2011 02:03 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:16 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft