+ Reply to Thread
Results 1 to 10 of 10

Hide/Unhide rows

  1. #1
    Registered User
    Join Date
    11-18-2009
    Location
    Qatar
    MS-Off Ver
    Excel 2003
    Posts
    21

    Hide/Unhide rows

    Hello again Guys,
    Need your help again.

    I am trying to figure out how to hide rows automatically when 1 row or more rows have zero (0) values and/or blank.
    Have attached here a working file for reference.

    What I'm doing now is entering data in Sheet1(a) and/or Sheet2(a). Data here are linked to the printed sheet-Sheet1 and Sheet2.
    Every month I will be printing this printed sheets numbering 10 or more and I will be adding more sheets to be printed in the future.
    Before printing, I have to hide row/s having all 0 values across calculated, for all the 10 or more printed sheets. (e.g. In Sheet1, rows 10, 16, 19, 23 and 37). So this takes time.
    Note that the columns in the printed sheet will probably remain the same.

    For this, is it possible as well for a toggle button to be utilized for all the codes in the printed sheets to run-a. hide the rows with 0s when toggle on and unhide the rows when toggle off. Likewise, the caption will change between toggle.

    This toggle button is placed in a summary sheet, but for this purpose, is placed in 1 - worksheet.

    Can you guys help me code this?

    Thanks in advance for the great help.
    Attached Files Attached Files
    Last edited by drean03; 03-10-2010 at 06:04 AM.

  2. #2
    Forum Contributor
    Join Date
    09-21-2009
    Location
    Belgium - Mechelen
    MS-Off Ver
    Office 365 - version 2310
    Posts
    278

    Re: Hide/Unhide rows

    Hi

    I added some code and another button on the workbook and renamed it.
    Perhaps this might help you.
    The code hides the rows with zero values , or it unhides all rows in the activeworksheet.
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    11-18-2009
    Location
    Qatar
    MS-Off Ver
    Excel 2003
    Posts
    21

    Re: Hide/Unhide rows

    Hello MarMo,

    First of all, thanks for your help. I was thinking all are quite busy now.

    I tried the attached file. It almost worked fine, but it seems row27 is also being hidden. It's not suppose to hide that row since there are data on column J27 and K27.

    Another thing is I have around 50 Printed worksheets out of 130 worksheets in my file.
    Would it be possible to insert some code in these 50 Printed worksheets then it will be called upon when the toggle button is pressed? Note the toggle button will be placed in some other worksheet.

    Thanks!

  4. #4
    Forum Contributor
    Join Date
    09-21-2009
    Location
    Belgium - Mechelen
    MS-Off Ver
    Office 365 - version 2310
    Posts
    278

    Re: Hide/Unhide rows

    drean03,
    I modified the code so row 27 is not hidden.
    the code only hides the rows where all columns are zero.
    The code is not optimal yet , but can be improved.

    as for your print sheets ; how can we or VBA see if the sheet needs to be printed?
    How do we distinguish the sheets ?

  5. #5
    Registered User
    Join Date
    11-18-2009
    Location
    Qatar
    MS-Off Ver
    Excel 2003
    Posts
    21

    Re: Hide/Unhide rows

    Quote Originally Posted by MarMo View Post
    drean03,
    I modified the code so row 27 is not hidden.
    the code only hides the rows where all columns are zero.
    The code is not optimal yet , but can be improved.

    as for your print sheets ; how can we or VBA see if the sheet needs to be printed?
    How do we distinguish the sheets ?
    Hello MarMo. Back again here.

    Yeah, I understand that those printed sheets should be enumerated and specifically defined in the code, but is it possible to put some code in those sheets to be printed and just be called upon when the toggle button is pressed? Or is it possible to put some unique identification which will be the same for the Printed sheets which will be identified by the code?

    Thanks again for the great help!

    Best Regards!

  6. #6
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Hide/Unhide rows

    Is this thread the same issue as this one:

    http://www.excelforum.com/excel-gene...ding-rows.html
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  7. #7
    Registered User
    Join Date
    11-18-2009
    Location
    Qatar
    MS-Off Ver
    Excel 2003
    Posts
    21

    Re: Hide/Unhide rows

    Quote Originally Posted by JBeaucaire View Post
    Is this thread the same issue as this one:

    http://www.excelforum.com/excel-gene...ding-rows.html
    So sorry here JB. I posted here first and thought no one answered, so posted again at the other forum.
    Again, my apology. Your call JB.

  8. #8
    Forum Contributor
    Join Date
    09-21-2009
    Location
    Belgium - Mechelen
    MS-Off Ver
    Office 365 - version 2310
    Posts
    278

    Re: Hide/Unhide rows

    drean03,
    I supose you do not need help on this post , as you get help on the other post?
    http://www.excelforum.com/excel-gene...ding-rows.html

  9. #9
    Registered User
    Join Date
    11-18-2009
    Location
    Qatar
    MS-Off Ver
    Excel 2003
    Posts
    21

    Re: Hide/Unhide rows

    Quote Originally Posted by MarMo View Post
    drean03,
    I supose you do not need help on this post , as you get help on the other post?
    http://www.excelforum.com/excel-prog...ding-rows.html
    No solution yet either MarMo. The other thread is closed. Thanks again.
    Last edited by drean03; 03-09-2010 at 08:34 AM.

  10. #10
    Registered User
    Join Date
    11-18-2009
    Location
    Qatar
    MS-Off Ver
    Excel 2003
    Posts
    21

    Re: Hide/Unhide rows

    Kalas. Finished. Our IT people solved the minor code!

+ 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