+ Reply to Thread
Results 1 to 3 of 3

Macro to hide rows

  1. #1
    Registered User
    Join Date
    07-27-2010
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    2

    Macro to hide rows

    Hello,

    We have an excel report that contains several groups of rows, separated by blank rows. Each group (Dept) contains several account balance lines.

    This is what we are trying to achieve:

    - If all the lines of a specific group have 0 balances ( making the group total 0 as well), hide the entire group.

    - If only certain lines of a group are 0's, and the group total is not 0, dont hide these lines

    - If the lines of a specific group are not 0, but the group total is 0, dont hide the group.

    I'm fairly new to vba, and have tried my best, without success, to resolve this issue. Any suggestions would be highly appreciated.

    Thanks.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Macro to hide rows

    Hello ontu78,

    Welcome to the Forum!

    Since I can envision several ways your data could arranged on the worksheet, why don't you post the workbook or at the very least post before and after examples of the data. Be sure the examples match the workbook.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    07-27-2010
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Macro to hide rows

    Quote Originally Posted by Leith Ross View Post
    Hello ontu78,

    Welcome to the Forum!

    Since I can envision several ways your data could arranged on the worksheet, why don't you post the workbook or at the very least post before and after examples of the data. Be sure the examples match the workbook.
    Hello Leith,

    Thanks for you response. Here is the sample.Based on this report, here is what we are trying to achieve:

    Scenario 1: Hide rows 3 and 4

    Scenario 2: Do not hide any rows

    Scenario 3: Do not hide any rows

    Scenario 4: Do not hide any rows

    Scenario 5: Do not hide any rows

    Scenario 6: Hide rows 26, 27,28,29 & 30.

    Hope this helps. Thanks
    Attached Files Attached Files

+ 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