+ Reply to Thread
Results 1 to 3 of 3

Need help creating a button to hide rows based on value of cell.

  1. #1
    Registered User
    Join Date
    06-25-2012
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    15

    Question Need help creating a button to hide rows based on value of cell.

    I am faced with a situation where I need the option to hide many rows with a button. I am unsure how to write the code to trigger a macro that would scan a column and depending on the value detected in each row, that row would be hidden.

    IE: it scans Column D for a check-mark or dash. If Row 2 is a dash it is hidden, however if Row 3 is a check mark, it is not.
    Additionally, I am not clear on how to create a button that would activate this macro, although I'm sure it is the easy part.

    I have attached a dummy workbook for reference to clarify what I am asking help for.

    Any help would be greatly appreciated!

    Thank you
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    01-01-2005
    MS-Off Ver
    2007
    Posts
    368

    Re: Need help creating a button to hide rows based on value of cell.

    Put the following code in a module and try it.

    Please Login or Register  to view this content.
    Elio Fernandes

  3. #3
    Valued Forum Contributor smuzoen's Avatar
    Join Date
    10-28-2011
    Location
    Brisbane, Australia
    MS-Off Ver
    Excel 2003/2007/2010
    Posts
    610

    Re: Need help creating a button to hide rows based on value of cell.

    To add a Button - Go to Developer, Insert, Form Controls, Button. Add the code above or the code below to a module. Right click on the Button, select Assign Macro and select the Macro name you wrote in the Module. See attached workbook for example.
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Hope this helps.
    Anthony
    Pack my box with five dozen liquor jugs
    PS: Remember to mark your questions as Solved once you are satisfied. Please rate the answer(s) by selecting the Star in the lower left next to the Triangle. It is appreciated?

+ 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