+ Reply to Thread
Results 1 to 5 of 5

Creating a macro button with VBA

  1. #1
    Forum Contributor
    Join Date
    08-22-2011
    Location
    Texas, United States
    MS-Off Ver
    Excel 2007 and 2010
    Posts
    516

    Creating a macro button with VBA

    Hi All,

    I have a macro that is attached to a run button. when the macro is finished it will have created 15 tabs and done many calculations. I would like to have a reset button to return the workbook to it's original form. Although i would not like the user to be able to see the reset button until he/she has run the 'Run' button. I already have the reset code, i would just like the 'Run' macro to at the end create a button called 'Reset' that will show up on sheet1 and assign my reset code to it. Thanks for any help.
    Regards,
    amotto

    If I helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)

  2. #2
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Creating a macro button with VBA

    amotto11,

    While that specific request is doable, it is much easier to have the button already created, but set its visible property to false. Then, at the end of your run button, make the reset button visible. At the end of the reset button code, make the reset button invisible again. Note that invisible buttons cannot be clicked.
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Forum Contributor
    Join Date
    08-22-2011
    Location
    Texas, United States
    MS-Off Ver
    Excel 2007 and 2010
    Posts
    516

    Re: Creating a macro button with VBA

    Okay, that makes total sense, do you have any sample code to make a button visible or not?

    Thanks

  4. #4
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Creating a macro button with VBA

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    08-22-2011
    Location
    Texas, United States
    MS-Off Ver
    Excel 2007 and 2010
    Posts
    516

    Re: Creating a macro button with VBA

    Thanks so much for the help!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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