How to Learn Macros in Excel 2007
Excel macros are pieces of code that you can use to automate repetitive tasks and customize Excel 2007 to fit your needs. You don't need to know a programming language to build a macro. Excel's Record Macro function will record your keystrokes and generate code in the background. When you want to execute the code, you can press a keyboard combination of your choosing or run the macro from the "Macro" menu.
Instructions
-
-
1
Click on the "Developer" tab to bring up the ribbon.
-
2
Click the "Record Macro" button in the Code frame of the Developer ribbon.
-
-
3
Type your desired macro name into the "Macro Name" text box, then type the shortcut key you want to use to access your macro in the "Shortcut Key" text box. Click "OK." For example, you might name your macro "AddEmphasis" and set the shortcut key to "E."
-
4
Format your spreadsheet in whatever way you want. Whatever you do now will be repeated when you run the macro in the future. For example, you might italicize the text in a cell and change the background to yellow.
-
5
Click the "Stop Recording" button in the Code section of the Developer ribbon.
-
6
Press "Ctrl" and the shortcut key you chose in Step 3 at the same time. For the example, if you press "Ctrl" and "E" at the same time, the active cell will become italic and the background will turn yellow. You now have a working macro.
-
1
Tips & Warnings
If you are an advanced user, you can also edit macro code by pressing "Alt" and "F11" at the same time to access the Visual Basic editor.
References
- Photo Credit keyboard image by Fyerne from Fotolia.com