+ Reply to Thread
Results 1 to 7 of 7

Macro to loop through column, if blank blank cells then hide rows

Hybrid View

  1. #1
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Lightbulb Try this !

    It's weird to not attach a real layout workbook in the initial post except if you are able to modify any code …

    According to your last attachment, paste this demonstration to the Sheet1(Summary Stats) worksheet module :

    PHP Code: 
    Sub Demo1()
           
    Dim A$, Rg As Range
           Application
    .ScreenUpdating False
        With Me
    .UsedRange.Columns(5)
               
    Set Rg = .Find("BUY", , , xlWhole)
            If 
    Not Rg Is Nothing Then
               A 
    Rg.Address
                
    Do
                    
    With Rg(12).Resize(2)
                        If 
    Application.CountBlank(.Cells) = 2 Then .EntireRow.Hidden True
                    End With
                       Set Rg 
    = .FindNext(Rg)
                
    Loop Until Rg.Address A
               Set Rg 
    Nothing
            End 
    If
        
    End With
           Application
    .ScreenUpdating True
    End Sub 
    ► Do you like it ? ► ► So thanks to click on bottom left star icon « Add Reputation » !
    Last edited by Marc L; 05-25-2019 at 05:06 AM. Reason: ScreenUpdating optimization …

  2. #2
    Registered User
    Join Date
    11-28-2018
    Location
    Netherlands
    MS-Off Ver
    Office 13
    Posts
    30

    Re: Try this !

    thank you so much, I really appreciate

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] macro to remove rows if all cells from columns are blank except first column
    By tikistat in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-05-2017, 08:08 AM
  2. [SOLVED] Macro for Hide blank rows and Unhide the rows with cells
    By Neilesh Kumar in forum Excel General
    Replies: 4
    Last Post: 04-12-2017, 06:06 AM
  3. Hide rows for blank Cells when there is another blank cell below
    By bilich in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-16-2016, 08:29 PM
  4. Hide Rows for First Set of Consecutive Blank Cells in Column
    By pastuslm in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 04-22-2015, 03:22 PM
  5. [SOLVED] Macro to fill blank cells in column A based on non-blank cells
    By ktalamantez in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-28-2014, 02:47 PM
  6. Macro to delete blank rows if column I is blank for the row
    By tiger10012 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-10-2013, 03:01 PM
  7. [SOLVED] Hide any rows 5 through 16 in which column H is blank
    By Triscia in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-14-2013, 04:30 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1