VBA - ToggleButton Hide/Unhide Rows

  • I'm new to VBA and am trying to figure out a way to do the following.
    I have 3 spreadsheets (Live, Control, Compare). Live & Control have a list of names in D8:D99 and Compare has a list in A7:A98 with a number field in B7:B98.
    I want to create a toggle button that will hide rows based on the criteria below (as well as unhide all rows if clicked again).
    - If value in B is 0 AND
    - Name in Compare is on both Live & Control lists

    If the name in B7:B98 is missing from either Live or Control list or the value > 0, I do not want to hide the row.

    Any help would be greatly appreciated. Thanks!

  • Re: VBA - ToggleButton Hide/Unhide Rows

    Try this:

    You can assign the code to a toggle button. (Let me know if you need help doing that). There are two macros here, one to hide all the rows that meet your criteria, and another to unhide all rows.

    Let me know how it works!

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!