How to Use Excel Macro

By Patricia Bryant Resnick

Windows Excel is a very powerful spreadsheet program and probably the one used most commonly on today's computers. There are a lot of tools at hand and it can get confusing, but it can also give you a lot of ways to make your job a lot easier. One of the simplest is the Macro. If you have a commonly used phrase or piece of text or data, you can have Excel plug it in with just a couple of keystrokes. Read on to learn how to use Excel Macro.

Things You'll Need

  • A computer with Microsoft Office Excel installed

Step 1

Pick your block of text and have it in front of you to read as you type. On the main menu bar, click on "Tools," "Macro" and "Record New Macro."

Step 2

A box will pop up and you will need to enter at least two things. You need to know what to call your new macro, and you need to know what shortcut key you want to use for it. We are calling ours "example" and the shortcut key will be "CTRL/SHIFT/E. excel macro2.jpg"

Step 3

Click on "OK" and you are ready to start entering your macro. Type only and exactly the data you want to appear for this macro. We're using the word, example, as an example.

Step 4

Type example, then click on "Tools," "Macro" and "Stop Recording." This will finish your macro and make it available to you.

Step 5

Click "CTRL/SHIFT/E" to run the macro that will insert the word "example." It will insert the text in the active cell.

Step 6

Make it easier to use macros. Click on "Tools" then on "Customize." Select the "Toolbars" tab, then check the box next to "Visual Basic." Now click "Closed." You can drag the toolbar to the upper border with the other toolbars.

Tips & Warnings

  • Type slowly and carefully while typing the text for your macro. It's OK if you back up and correct, but it's easy to lose track of what you're doing.
  • If you mess up, open "Macros" and delete the bad macro so that you can start again.
  • Mouse over the buttons on the Visual Basic toolbar to see what they do.
  • If you have a large block of text to insert into a macro, it may be easier to enter your text elsewhere and then copy and paste it into your macro code. Use "Step Into Macro" to go into Visual Basic and paste the text into place.
  • Don't use common command keys for your macros.
  • A good habit is to always use both "Shift" and "Control" together for your macros.