+ Reply to Thread
Results 1 to 7 of 7

Hide unhide blank rows?

  1. #1
    Registered User
    Join Date
    01-25-2009
    Location
    Florida, USA
    MS-Off Ver
    Excel 2003
    Posts
    78

    Hide unhide blank rows?

    Hello

    I came across this code which hides /unhides blank rows between data cells in a column range. When double clicked, It searches for the next cell with data and hides all the blank rows in between.

    It works great for hiding the blank rows, but if double clicked again, it unhides all of the rows from the active cell down.
    Ideally I would like it to unhide only those hidden rows between the active cell to the next cell with data.

    I've been racking my brain for hours trying to modify this with no success.
    Any ideas how can this be modified?

    Please Login or Register  to view this content.
    Thanks for any help

    Jeff

  2. #2
    Forum Expert DGagnon's Avatar
    Join Date
    02-23-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2003, 2007
    Posts
    1,645

    Re: Hide unhide blank rows?

    Give this a shot, it will check if i = 1048576 (the last cell in an xlsx book) if it does it will exit the macro

    Please Login or Register  to view this content.
    If you liked my solution, please click on the Star -- to add to my reputation

    If your issue as been resolved, please clearly state so and mark the thread as [SOLVED] using the thread tools just above the first post.

  3. #3
    Forum Expert DGagnon's Avatar
    Join Date
    02-23-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2003, 2007
    Posts
    1,645

    Re: Hide unhide blank rows?

    Just noticed you are on Excel 2003, if that is the case, you can change the code to this:

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    01-25-2009
    Location
    Florida, USA
    MS-Off Ver
    Excel 2003
    Posts
    78

    Re: Hide unhide blank rows?

    Thanks, DGagnon

    But it still yields the same results. The code needs an addition which only unhides the rows between the active cell and the next cell with data.

    As an example: when all blank rows are unhidden:

    .......A...B...C
    11
    12...data
    13
    14
    15...data
    16
    17
    18
    19...data
    20

    when blank rows are hidden.

    .......A...B...C
    11
    12...data
    15...data
    19...data
    20

    Ideally if all blank rows are hidden, and cell A:12 is double clicked, it should only reveal the Rows between the active cell, A:12 and the next cell with data A:15

    .......A...B...C
    11
    12...data
    13
    14
    15...data
    19...data
    20


    The current code unhides all empty rows.. (as in the first example )



    Thanks for the help on this!

    Jeff

  5. #5
    Forum Expert DGagnon's Avatar
    Join Date
    02-23-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2003, 2007
    Posts
    1,645

    Re: Hide unhide blank rows?

    sorry i read the request to quick, try this:

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    01-25-2009
    Location
    Florida, USA
    MS-Off Ver
    Excel 2003
    Posts
    78

    Re: Hide unhide blank rows?

    Beautiful!

    Thank you very, very much DGagnon!!

  7. #7
    Forum Expert DGagnon's Avatar
    Join Date
    02-23-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2003, 2007
    Posts
    1,645

    Re: Hide unhide blank rows?

    no problem, glad i could help.

    Could you please mark this thread as solved?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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