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
Bookmarks