+ Reply to Thread
Results 1 to 4 of 4

Toggle Button Code

  1. #1
    Registered User
    Join Date
    12-11-2012
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2010
    Posts
    7

    Toggle Button Code

    Hi

    I am looking for a macro (as simple as possible) to attach to a toggle button.

    What I want to happen when the button is clicked is:

    Click Once:
    1. Looks at range (say a1:a100) and where the cell value = "hide", it hides that row.
    2. Changes the text on the button to Show

    Click Twice
    1. Unhides all rows in range A1:a100 where cell value = "hide"
    2 Changes the text on the button to Hide


    Thanks.

  2. #2
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Toggle Button Code

    assuming the toggle button is called ToggleButton1

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    12-11-2012
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Toggle Button Code

    Exactly what I needed. Thank you.

  4. #4
    Registered User
    Join Date
    12-11-2012
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Toggle Button Code

    Hi Stnkynts

    One last question

    If I wanted to put "hide" in to row 1 of columns A:AZ, how do I add that to the macro?

    I would need the top half of the macro to also check the value of row 1 and if equal to "hide", then hide the column

    And in the bottom half, the second click of the toggle button would unhide the columns also.

    Thanks.

+ 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