MS-Excel / General Formatting

Running a Macro

After recording your macro, you will want to give it a test to make sure that the macro does what you intended. Follow these steps to test your Macro1:

  1. Open a new Excel worksheet and place your cellpointer in cell A1.
  2. Press ctrl+shift+m.
  3. Your name should now appear in cell A1 and the cellpointer has moved to cell A2. The macro is a work!

What happens if you place your cellpointer in a cell other than cell A1 and press the keyboard shortcut for the macro command? Let's give it a try. Click in any other cell (other than cell A1) on the worksheet, then press ctrl+shift+n. What happens? Your macro appears in the cell where your cellpointer resided, but now the cellpointer is sitting in cell A2. In fact, no matter what cell you start in, when you run the Macro1 macro, your name will be entered in the cell where you start, and your cellpointer will return to cell A2.

If you think back to the creation of the Macro1 macro, you will remember that you recorded entering your name in cell A1, having already placed your cellpointer in that cell before beginning the recording process. Then you pressed enter, and the cellpointer moved to cell A2. The macro recorded just that-the process of entering your name in the currently occupied cell, and then the process of your cellpointer moving to cell A2. So, no matter where you are when you play back this macro, your cellpointer is going to scurry back to cell A2 after entering your name.

[Previous] [Contents] [Next]