Name simple macros
- 1View › Macros › Record Macro.
- 2Macro name: the exact name the task gives, such as FormatHeader.
- 3Store macro in: This Workbook.
- 4OK, record, then Stop Recording.
The name is set in the Record Macro dialog, before you record. It must be a single word Excel can use as a VBA name, and the task's spelling is the one the grader looks for.
What the MO-211 task asks
Every recording task in our MO-211 practice exams names the macro: FormatHeader, ClearFares, NightClose, RoundClose. Our grader's first check is that a macro of exactly that name exists in the workbook, so the name is worth as many points as the steps.
A macro name is a VBA name: letters, digits and underscores, starting with a letter, with no spaces. Type the task's name exactly, in the same case, and store the macro in This Workbook.
Worked examples
Set up the grid below to follow along. Each example starts from it as shown; every result is what Excel showed.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Date | Vessel | Berth | Fee |
- 1Name the macro Format_Header.
Underscores are allowed, so Format_Header is a usable name.
- 1Name the macro Format Header.
A space splits the name into two words. Use FormatHeader or Format_Header.
- 1Name the macro 2Header.
A macro name has to start with a letter.
- 1Record Macro.
- 2Macro name FormatHeader, Store macro in This Workbook.
- 3OK, Ctrl+B on A1:D1, Stop Recording, then Alt+F8.
The name and the store choice, done in Excel.
Watch it done in Excel
The last example above, recorded in real Excel on the same grid.
Exam traps
Format_Header is a valid name, but it is not FormatHeader. The grader looks for the name the task gives.
The dialog suggests Macro1. Selecting OK without changing it records a macro the task did not ask for.
The name can be right and the macro still missing from the file, if Store macro in is set to Personal Macro Workbook.
FAQ
Can I rename a macro after recording it?
Yes, in the Visual Basic Editor: change the name after Sub on the macro's first line.
Does case matter?
Excel treats formatheader and FormatHeader as the same macro, but type the task's name as given.
What is the shortcut key box for?
It assigns Ctrl+ a letter to run the macro. The tasks do not ask for one, so leave it empty.
Try it under exam conditions
Take a full, timed MO-211 practice exam, upload the workbook you built, and get a score out of 1000 with a per-task breakdown of where the points went. Your first one is free.
No credit card needed.
