Results 1 to 5 of 5

Need macro's behavior to depend on button pushed

Threaded View

JChandler22 Need macro's behavior to... 03-26-2010, 03:25 PM
royUK Re: Need macro's behavior to... 03-26-2010, 03:52 PM
wotadude Re: Need macro's behavior to... 03-28-2010, 04:13 PM
JChandler22 Re: Need macro's behavior to... 03-29-2010, 09:57 AM
royUK Re: Need macro's behavior to... 03-29-2010, 11:46 AM
  1. #1
    Forum Contributor
    Join Date
    06-25-2007
    Posts
    166

    Need macro's behavior to depend on button pushed

    Hi All,

    I have a spreadsheet with several different sections of data. I'd like to have a button within each section to run a macro (what the macro does is less important), but I'd like to just create one single macro which will work on all of the sections.

    In short, I'm wondering if there's a way to create a single macro, have multiple buttons linked to that one macro, but have the behavior of the macro vary depending on which button is pushed.

    For instance, the macro called myMacro will shade the top left cell of section X green. Three different sections - A, B, and C - each have a button linking to myMacro. If the button in section C is pushed, the top left cell of section C will be shaded green; if the button in section A is pushed, the top left cell of section A will be shaded green.

    Is there a way for a macro to detect which button was pushed, and modify behavior accordingly? I'd like to avoid having to create a separate macro for each section if at all possible. I've done some forum and google searches to try to find answers on this but I've come up short. If anyone has any helpful resources on this topic I'd greatly appreciate it.

    Many thanks in advance,
    Jeff
    Last edited by JChandler22; 03-29-2010 at 09:57 AM.

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