PDA

View Full Version : [SOLVED] Macro Button



zoom38
08-05-2014, 10:59 AM
Can anyone advise why when I click on the macros button that the name of the first macro in the list becomes the active cell?
In other words, my first macro in the list is Add204. When I click the macros button, cell "ADD204" will activate on the active sheet. Very annoying.



Excel 2010
Windows 7

Bob Phillips
08-05-2014, 11:46 AM
Because ADD204 is a cell in Excel 2007->, so it jumps to it. You should never use a cell refernce as a defined name or a macro, use Add_204 or such.

zoom38
08-05-2014, 12:17 PM
I did rename it to that. I was just curious. Seems to me that shouldn't happen.

thanks
gary

Aussiebear
08-05-2014, 03:52 PM
Seems to me that shouldn't happen.

Excel requires the User to be a little disciplined in how they intend to use the program whether at the Object level or within the programming level. Just like A1 is a cell reference so too is ADD204, so as Bob kindly suggested simply use an underscore to differentiate the Macro name from any potential cell reference.