+ Reply to Thread
Results 1 to 11 of 11

Hiding row if column sum value equals 0

  1. #1
    Registered User
    Join Date
    03-22-2011
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    63

    Hiding row if column sum value equals 0

    Hi,

    I have searched few topics, all had something similar but it didn't seem to work for me. I need to say I have no idea of VBA code, I only realize that if I need it running all the time I need to add it through worksheet code and if I want a button thorugh a module.

    So idea is as mentioned in the topic, I want to hide a row if column value, for ex. "I.3.Change in receivables after one year" sum C5:K5 equals 0.
    I added and example, but it contains numbers only, original file has only fomulas, so if value would become non-zero it should be visable again.

    If anyone could help me with this it would be great.

    Regards,
    drakaz
    Attached Files Attached Files
    Last edited by drakaz; 03-19-2013 at 04:02 AM.

  2. #2
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Hiding row if column sum value equals 0

    Does this help?

    Please Login or Register  to view this content.

  3. #3
    Valued Forum Contributor abduljaleel.mca's Avatar
    Join Date
    02-13-2013
    Location
    Chennai, India
    MS-Off Ver
    MS 365 Business
    Posts
    326

    Re: Hiding row if column sum value equals 0

    you can use this attached macro
    Attached Files Attached Files
    Last edited by abduljaleel.mca; 03-15-2013 at 09:27 AM.

  4. #4
    Registered User
    Join Date
    03-22-2011
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    63

    Re: Hiding row if column sum value equals 0

    Quote Originally Posted by JOHN H. DAVIS View Post
    Does this help?

    Please Login or Register  to view this content.

    I'm not sure if code isn't working or I'm doing something wrong, as nothing happens when I add it through "View Code". I tried it with macro, it's the same as code below - doesn't unhide rows when column sum isn't 0 anymore.
    Last edited by drakaz; 03-15-2013 at 10:02 AM.

  5. #5
    Registered User
    Join Date
    03-22-2011
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    63

    Re: Hiding row if column sum value equals 0

    Quote Originally Posted by abduljaleel.mca View Post
    you can use this attached macro
    Macro works one way, it hides the rows, but doesn't unhide them when they are not 0 anymore. If unhide would work that would be perfect even with a macro.

  6. #6
    Valued Forum Contributor abduljaleel.mca's Avatar
    Join Date
    02-13-2013
    Location
    Chennai, India
    MS-Off Ver
    MS 365 Business
    Posts
    326

    Re: Hiding row if column sum value equals 0

    I have checked the macro, it works in both the way. Please check it again.
    *Make sure that you are passing values from another sheet for these cells.

  7. #7
    Registered User
    Join Date
    03-22-2011
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    63

    Re: Hiding row if column sum value equals 0

    Ok, I see it now. But it is not possible to make it work if data is in the same sheet?
    OK, not sure what changed but now it works even with values in the same sheet. Thanks a million!
    Last edited by drakaz; 03-15-2013 at 10:44 AM.

  8. #8
    Valued Forum Contributor abduljaleel.mca's Avatar
    Join Date
    02-13-2013
    Location
    Chennai, India
    MS-Off Ver
    MS 365 Business
    Posts
    326

    Re: Hiding row if column sum value equals 0

    Not a problem, you can work on the same sheet itself.

  9. #9
    Registered User
    Join Date
    03-22-2011
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    63

    Re: Hiding row if column sum value equals 0

    Is there a way I could limit that macro would work only in certain cells, for ex. C8:K12?

  10. #10
    Valued Forum Contributor abduljaleel.mca's Avatar
    Join Date
    02-13-2013
    Location
    Chennai, India
    MS-Off Ver
    MS 365 Business
    Posts
    326

    Re: Hiding row if column sum value equals 0

    Attached file will work only for the range 'C8:K12'.
    Need to change the 'for loop' as per your desire cells.
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    03-22-2011
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    63

    Re: Hiding row if column sum value equals 0

    Thanks again, marking this topic 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