+ Reply to Thread
Results 1 to 6 of 6

Hiding rows not containing any data

  1. #1
    Registered User
    Join Date
    10-27-2020
    Location
    USA
    MS-Off Ver
    Office 365
    Posts
    3

    Hiding rows not containing any data

    Dear friends,


    I have simple requirement to hide (or suppress) the rows that do not contain any data. In the attached screenshot, I want to hide the rows 2,6:9 (highlighted in green) as these rows have data/value.

    I want rows 3:5 not be be hidden (highlighted in yellow) as it has data/value in these rows.

    Kindly advice on the code.

    Screen Shot Excel Forum.png



    Thanks,
    Rahul
    Last edited by vsb1.tech; 08-22-2022 at 09:57 AM.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,077

    Re: Hiding rows not containing any data

    What does "I have following code and it is not working" mean? Doesn't do anything? Doesn't do something it should? Does something it shouldn't? Crashes Excel?

    You don't need to select anything.

    Please Login or Register  to view this content.
    What do you need to happen? That isn't checking for empty rows. What IS an empty row? Cells that have no data or formulae? Cells that have formulae that return null values?

    Maybe:
    Please Login or Register  to view this content.

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,077

    Re: Hiding rows not containing any data

    Fast answers need visual help. Please read the yellow banner at the top of this page on how to attach a file.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Valued Forum Contributor
    Join Date
    05-03-2022
    Location
    Halifax,Canada
    MS-Off Ver
    365
    Posts
    326

    Re: Hiding rows not containing any data

    Following code selects empty rows of active sheet specfied rows ... and hides them

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    10-27-2020
    Location
    USA
    MS-Off Ver
    Office 365
    Posts
    3

    Re: Hiding rows not containing any data

    Hi TMS,

    Thanks for your reply.

    I need a code that hide the rows ("112:350") if there is no data/value in these row. But if there is data/values then the rows containing the data should not be hidden. My code doesn't do anything. I tried your code and it hides the rows defined in range. But can you help me to add the condition that the rows are hidden only if it does not have any data. If any row in the range has data then those rows should not be hidden.

    Thank,
    Rahul

  6. #6
    Valued Forum Contributor
    Join Date
    05-03-2022
    Location
    Halifax,Canada
    MS-Off Ver
    365
    Posts
    326

    Re: Hiding rows not containing any data

    Heres one solution

    Please Login or Register  to view this content.
    ASSUMPTIONS ( as per sample)
    Column "A" is the description column and will always have a value
    The sheet be used is the "activesheet"

    If this helps please consider clicking "add reputation" , thx
    Last edited by nimrod1313; 08-22-2022 at 06:23 PM.

+ 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. Automatically Hiding Rows and Columns with No Data
    By itsawayoflife in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-14-2018, 04:12 AM
  2. Excel Hiding/Deleting Rows of Data?? (HELP)
    By Osensnolf in forum Excel General
    Replies: 1
    Last Post: 01-25-2013, 11:54 AM
  3. Replies: 6
    Last Post: 06-18-2012, 01:26 AM
  4. Hiding rows between the last row of data and row 100
    By MasonSinclair in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-23-2011, 03:37 AM
  5. Hiding the Rows While Searching Data
    By abrarsworld in forum Excel General
    Replies: 2
    Last Post: 02-21-2010, 01:22 PM
  6. Hiding rows depending on data
    By oakman in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-03-2006, 12:21 PM
  7. [SOLVED] Hiding column/row labels --without hiding entire columns/rows
    By daniel.wolff@csfb.com in forum Excel General
    Replies: 2
    Last Post: 10-18-2005, 10:05 PM

Tags for this Thread

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