First time creating a Macro

blakrapter

New Member
Joined
Oct 16, 2006
Messages
13
Hello everyone,

I am new here and found this board while searching for an answer to my problem. I did not find the answer, but it looks like this is the right board to ask. So, here it goes.

I am trying to create a macro for the fist time. I am using the record function in excel to do this, but cannot get past the first step. It doesnt matter what I try, I get the error "that name is not valid" I have tried all sorts of macro names and get this error every time. Whats the problem?

Thanks!
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.

Von Pookie

MrExcel MVP
Joined
Feb 17, 2002
Messages
13,686
What are you trying to use as a name? Macro names can not start with numbers or contain spaces or other "special" characters (such as ?,-/, etc.). You can use underscores, though.
 

SlinkRN

Well-known Member
Joined
Oct 29, 2002
Messages
702
Here are the rules for naming your macro:

The first character of the macro name must be a letter. Other characters can be letters, numbers, or underscore characters. Spaces are not allowed in a macro name; an underscore character works well as a word separator.

Do not use a macro name that is also a cell reference or you can get an error message that the macro name is not valid.

HTH, Slink
 

blakrapter

New Member
Joined
Oct 16, 2006
Messages
13
Wow, you guys respond fast. Thanks for the help so far.

I have tried the default name of Macro1, plus "auto", "update', "inventoryupdate", and some other totally random names. Nothing works.
 

Macropheliac

Board Regular
Joined
Aug 26, 2005
Messages
165

ADVERTISEMENT

Are you beginning with:
Code:
Sub
Ending with:
Code:
End Sub

Can you post the code?
 

blakrapter

New Member
Joined
Oct 16, 2006
Messages
13
I am not sure of what you are referring to. I am using the record function to create the macro, so I have not written any code. I am not sure where to look to find it.

Thanks!
 

SlinkRN

Well-known Member
Joined
Oct 29, 2002
Messages
702

ADVERTISEMENT

That's strange. Are you starting on a blank file or is this an Excel file that's already filled with data?
 

Macropheliac

Board Regular
Joined
Aug 26, 2005
Messages
165
I am not sure of what you are referring to. I am using the record function to create the macro, so I have not written any code. I am not sure where to look to find it.

Thanks!

My mistake. :confused: I miss understood.

Are you clicking Tools / Macro / Record New Macro?
 

blakrapter

New Member
Joined
Oct 16, 2006
Messages
13
I am using tools>macro>record new macro in a spreadsheet that already contains a lot of data.

thanks!
 

Forum statistics

Threads
1,141,596
Messages
5,707,303
Members
421,502
Latest member
PULBAG

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top