+ Reply to Thread
Results 1 to 4 of 4

Creating a Macro, that creates a new Button, which itself runs a Macro.. Possible?

  1. #1
    Registered User
    Join Date
    11-24-2009
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    2

    Creating a Macro, that creates a new Button, which itself runs a Macro.. Possible?

    Hi everyone,

    I'm struggling to find any help on this.

    I have a long complicated macro that processes a ton of data and gives the output in a new sheet. I then want to create new buttons (or some sort of user clickable triggers) on this new sheet that runs another macro.

    I have got the actual adding of buttons in the sheet working, but I can't find a way to automatically assign macros to newly generated buttons during runtime. Is this even possible (or are there any clever tricks I could use to get around this?)

    I think essentially what I'm wondering is if it is possible to have a macro can itself write:
    Please Login or Register  to view this content.
    to a sheet's underlying code. Or is there a way of dynamically assigning a macro to a click event of an object?

  2. #2
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Creating a Macro, that creates a new Button, which itself runs a Macro.. Possible

    Perhaps using OnAction?
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    12-15-2009
    Location
    USA
    MS-Off Ver
    2003,2007,2010,2013
    Posts
    28

    Re: Creating a Macro, that creates a new Button, which itself runs a Macro.. Possible

    StephenR's answer is correct. If you'd like to have a little fun with your button, you can add a Staple's style "easy" button. The code is in my blog here:Create an Easy Button

  4. #4
    Registered User
    Join Date
    11-24-2009
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Creating a Macro, that creates a new Button, which itself runs a Macro.. Possible

    Ah ha!

    I've been using Forms button objects which can't use OnAction, but using shape buttons work just as well.

    Many 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