Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Naming a Macro with a Letter
I have saved a series of macros to use in a workbook, but Excel will not
allow me to name a macro "C." I have used lots of other letters with no problem, but when I name a macro "C" it tells me that it is an invalid name. Is there any way around this? If not, what is the reasoning behind it? Any help will be greatly appreciated. Thanks! |
#2
|
|||
|
|||
I use xl2003 and I could name a macro "C".
But I couldn't run it via tools|macro|macros... I could write if I specified the module it was in (just typing: module1.c, then clicking Run was sufficient). In fact, if I created a sub named C in two different modules (module1.c and module2.c), then I could even just point at the macro I wanted to run and click run. But if I typed in that "module1.c" and tried to give it a nice shortcut under the Options button on that dialog, I had more trouble. I got an error message when I tried to use that shortcut: "The macro 'A:A' cannot be found." Which gives a hint why you shouldn't use the letter C as a name for a macro. I think excel wants you to avoid anything that looks like a range reference. Try naming a macro A1 and you get the same problem. If you've ever used xl in R1C1 reference style mode, you'll see that C is used to indicate the column. Excel can get confused so it doesn't want you to use that character as a macro name. The same kind of thing happens if you try to give a range a name that looks like it could be a reference. (And excel is more conservative--even if it can't be a range, excel will still put the kybash on it if it looks like it has the same format.) Carol wrote: I have saved a series of macros to use in a workbook, but Excel will not allow me to name a macro "C." I have used lots of other letters with no problem, but when I name a macro "C" it tells me that it is an invalid name. Is there any way around this? If not, what is the reasoning behind it? Any help will be greatly appreciated. Thanks! -- Dave Peterson |
#3
|
|||
|
|||
I could write if I specified the module it was in (just typing: module1.c, then
clicking Run was sufficient). should have been: I could run it if I specified the module it was in (just typing: module1.c, then clicking Run was sufficient). <<snipped |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Playing a macro from another workbook | Excel Discussion (Misc queries) | |||
Date macro | Excel Discussion (Misc queries) | |||
Can't get simple macro to run | Excel Worksheet Functions | |||
Macro and If Statement | Excel Discussion (Misc queries) | |||
Macro Formula revision? | Excel Worksheet Functions |