+ Reply to Thread
Results 1 to 7 of 7

Hiding Rows Based based upon cell value being blank

  1. #1
    Registered User
    Join Date
    05-09-2007
    Posts
    28

    Question Hiding Rows Based based upon cell value being blank

    Hi all,

    I have a problem:

    From the click of a button I require the macro to look at a pre-setup sheet (b) which has results from the first sheet (a)

    The table goes from Column A:U, and Rows 2:181

    What I require is: If B2 is blank hide row 2, If B3 is blank hide row 3... so on and so on until... If B181 is blank hide row 181


    Any help would be grealy appreciated!

    Thanks,

    Lee

  2. #2
    Forum Expert
    Join Date
    11-23-2005
    Location
    Rome
    MS-Off Ver
    Ms Office 2016
    Posts
    1,628
    Try with this macro:
    Please Login or Register  to view this content.
    Regards,
    Antonio

  3. #3
    Registered User
    Join Date
    05-09-2007
    Posts
    28
    Thanks for that antoka05, that's good.

    There is one problem with that though... it seems to do something, but nothing is hidden from it. I have B2, B22 and B42 with text in it, but when I press the button rows 2:181 are hidden.

    Please can you advise what to change?

    Thanks,

    Lee

  4. #4
    Forum Expert
    Join Date
    01-03-2006
    Location
    Waikato, New Zealand
    MS-Off Ver
    2010 @ work & 2007 @ home
    Posts
    2,243
    Hi Lee,

    Have you considered using the Autofilter [alt + d + f + f]?
    This can be done manually using the dropdown arrows or via a macro eg:

    Please Login or Register  to view this content.
    btw, I can't remember clearly but I think that the sheet being filtered must be the visible (& active) one for this to work.


    hth,
    Rob
    Rob Brockett
    Kiwi in the UK
    Always learning & the best way to learn is to experience...

  5. #5
    Registered User
    Join Date
    05-09-2007
    Posts
    28
    Thanks broro183, that works a treat

  6. #6
    Forum Expert
    Join Date
    11-23-2005
    Location
    Rome
    MS-Off Ver
    Ms Office 2016
    Posts
    1,628
    I have no idea because there is that issue... please try with this code (it tests cells in column 'B'):

    Please Login or Register  to view this content.
    Regards,
    Antonio

  7. #7
    Registered User
    Join Date
    05-09-2007
    Posts
    28
    Thanks Antonio, but it didn't work. I think I'll stick to broro183's use of AutoFilter.

    Lee

+ 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