+ Reply to Thread
Results 1 to 5 of 5

Macro in a Toggle Button

  1. #1
    Registered User
    Join Date
    07-19-2009
    Location
    New Yoek
    MS-Off Ver
    Excel 2003
    Posts
    35

    Macro in a Toggle Button

    Hello ,

    I was wondering if it's possible to use this macro code in a toggle to perform this action when it's true and when the toggle is click again it can undo it.

    This macro does lookups and finds the max on sets of value when it is run and i was wondering if by clicking the button again it can undo what it placed in the cells...

    Any thoughts?

    Gratias...

    Please Login or Register  to view this content.
    Last edited by Preatorian; 07-28-2009 at 09:21 AM.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Macro in a Toggle Button

    Do you mean delete the formulas?

    Once the macro has run the first time the rngData variale will be cleared, Excel cannot store the variable so when you lick again there will be no blank cells to set the variable to.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    07-19-2009
    Location
    New Yoek
    MS-Off Ver
    Excel 2003
    Posts
    35

    Re: Macro in a Toggle Button

    Hmm, lets see.

    The macro runs and places the data in the cells accorindgly, right now it is also place the formula as well. What i was thinking is that the toggle would clear the data in the cells.

    So, in simplest terms, toggle clicks, runs macro, places data in cell. Click macro again and remove the data.

    Is this something tha can be done?.

    Gratias,...

  4. #4
    Forum Contributor
    Join Date
    02-23-2006
    Location
    Near London, England
    MS-Off Ver
    Office 2003
    Posts
    770

    Re: Macro in a Toggle Button

    The issue is that you find the cells originally by looking over a range for the blanks. You can't then do that again as they will no longer be blank.
    If you are just wanting to Clear the cells on the second click, (so that they are empty) you could do something like this:
    Please Login or Register  to view this content.
    If you find the response helpful please click the scales in the blue bar above and rate it
    If you don't like the response, don't bother with the scales, they are not for you

  5. #5
    Registered User
    Join Date
    07-19-2009
    Location
    New Yoek
    MS-Off Ver
    Excel 2003
    Posts
    35

    Re: Macro in a Toggle Button

    Kool...You da man.

    No need to use toggle with this...Works great.....

+ 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