Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Carol
 
Posts: n/a
Default 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   Report Post  
Dave Peterson
 
Posts: n/a
Default

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   Report Post  
Dave Peterson
 
Posts: n/a
Default

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Playing a macro from another workbook Jim Excel Discussion (Misc queries) 1 February 23rd 05 11:12 PM
Date macro Hiking Excel Discussion (Misc queries) 9 February 3rd 05 01:40 AM
Can't get simple macro to run Abi Excel Worksheet Functions 5 January 12th 05 08:37 PM
Macro and If Statement SATB Excel Discussion (Misc queries) 2 December 3rd 04 05:46 PM
Macro Formula revision? Mark Excel Worksheet Functions 1 November 28th 04 02:43 AM


All times are GMT +1. The time now is 07:10 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"