ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   record macro "That name is not valid." (https://www.excelbanter.com/excel-discussion-misc-queries/175983-record-macro-name-not-valid.html)

highlifesipper

record macro "That name is not valid."
 
I'm trying to learn how to use macros and start out by trying to record one.

I went:
Tools
Macro
Record New Macro....

For "Macro name:" I left "Macro1"

click "OK" and get an error message...."That name is not valid."

I've tried everything....starting with a letter, no spaces, opening a new
workbook...keep getting the same error message

--
highlifesipper

ExcelBanter AI

Answer: record macro "That name is not valid."
 
Hi highlifesipper,

I'm sorry to hear that you're having trouble recording a macro in Excel. Let's see if we can figure out what's going on.

First, let's make sure that you're following the correct steps to record a macro:
  1. Click on the "Developer" tab in the ribbon. If you don't see the Developer tab, you may need to enable it in Excel's options.
  2. Click on the "Record Macro" button in the "Code" group.
  3. In the "Record Macro" dialog box, enter a name for your macro in the "Macro name" field. Make sure the name starts with a letter and doesn't contain any spaces or special characters.
  4. Choose where you want to store the macro. You can store it in the current workbook or in your Personal Macro Workbook, which is a hidden workbook that stores macros that you can use in any workbook.
  5. Click "OK" to start recording the macro.

If you're still getting the "That name is not valid" error message, there are a few things you can try:

1. Make sure that the name you're entering for the macro doesn't already exist in the workbook or in your Personal Macro Workbook.

2. Try using a different name for the macro. Make sure the name starts with a letter and doesn't contain any spaces or special characters.

3. If you're still having trouble, try restarting Excel and recording the macro again.

Conan Kelly

record macro "That name is not valid."
 
highlifesipper,

Macro names can not contain spaces.

There are some other restrictions, but I don't remeber them off the top of
my head.

HTH,

Conan


"highlifesipper" wrote in message
...
I'm trying to learn how to use macros and start out by trying to record
one.

I went:
Tools
Macro
Record New Macro....

For "Macro name:" I left "Macro1"

click "OK" and get an error message...."That name is not valid."

I've tried everything....starting with a letter, no spaces, opening a new
workbook...keep getting the same error message

--
highlifesipper




Tyro[_2_]

record macro "That name is not valid."
 
Macro1 is a valid name. I've used it many times when I'm not going to keep
the macro. Try a name like ABCDEF and see what happens.

Tyro

"highlifesipper" wrote in message
...
I'm trying to learn how to use macros and start out by trying to record
one.

I went:
Tools
Macro
Record New Macro....

For "Macro name:" I left "Macro1"

click "OK" and get an error message...."That name is not valid."

I've tried everything....starting with a letter, no spaces, opening a new
workbook...keep getting the same error message

--
highlifesipper




JLatham

record macro "That name is not valid."
 
Basically, without looking up a reference with a specific list, you can't
have spaces in a macro name, and the name must start with a letter of the
alphabet. There are probably some special characters that can't be used, but
I don't know what they are at the moment, because I always stick to a few
'rules' when I create a Sub or Function name:
begin the name with a letter of the alphabet
only use letters from the alphabet, numbers and the underscore ( _ )
character within the name.
Keep it reasonably short.

Examples of names I might use:
MyFirstMacro
My_First_Macro
sort_ByNumber
sort_ByName
sort_BySSAN

Conan is correct, "Macro1" should be a valid name as long as it doesn't have
any spaces in it anywhere. And it is odd that Excel is telling
highlifesipper that the name is invalid, when it created the name itself!
(one good reason for never naming a macro by starting the name with the word
Macro followed by a number).

If highlifesipper had tried manually entering the name "Macro1" and
continuing, I could perhaps understand why he's getting an error (Excel may
have previously used that name and so wouldn't like someone trying to use it
again). But I don't understand why Excel is assigning that name and then
refusing to validate it.

"Conan Kelly" wrote:

highlifesipper,

Macro names can not contain spaces.

There are some other restrictions, but I don't remeber them off the top of
my head.

HTH,

Conan


"highlifesipper" wrote in message
...
I'm trying to learn how to use macros and start out by trying to record
one.

I went:
Tools
Macro
Record New Macro....

For "Macro name:" I left "Macro1"

click "OK" and get an error message...."That name is not valid."

I've tried everything....starting with a letter, no spaces, opening a new
workbook...keep getting the same error message

--
highlifesipper





Dave Peterson

record macro "That name is not valid."
 
Just a guess--and I got a different error when I tested this.

Do you have a module named Macro1?
Did you rename the project to Macro1?

Did you use that name somewhere else?

highlifesipper wrote:

I'm trying to learn how to use macros and start out by trying to record one.

I went:
Tools
Macro
Record New Macro....

For "Macro name:" I left "Macro1"

click "OK" and get an error message...."That name is not valid."

I've tried everything....starting with a letter, no spaces, opening a new
workbook...keep getting the same error message

--
highlifesipper


--

Dave Peterson


All times are GMT +1. The time now is 07:18 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com