Thursday, 7 August 2014

MS Excel Basic - How to Record a macro in Excel?

  1. Set the security level to Medium or Low:
     
  2. On the Tools menu, point to Macro, and then click Record New Macro. 
  3. In the Macro name box, enter a name for the macro. Notes
    • 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.
  4. If you want to run the macro by pressing a keyboard shortcut key, enter a letter in the Shortcut key box. You can use CTRL+ letter (for lowercase letters) or CTRL+SHIFT+ letter (for uppercase letters), where letter is any letter key on the keyboard. The shortcut key letter you use cannot be a number or special character such as @ or #. Note  The shortcut key will override any equivalent default Microsoft Excel shortcut keys while the workbook that contains the macro is open.

  5. In the Store macro in box, click the location where you want to store the macro. If you want a macro to be available whenever you use Excel, select Personal Macro Workbook.

  6. If you want to include a description of the macro, type it in the Description box.

  7. Click OK. 
  8. If you want the macro to run relative to the position of the active cell, record it using relative cell references. On the Stop Recording toolbar, click Relative Reference so that it is selected. Excel will continue to record macros with relative references until you quit Excel or until you click Relative Reference again, so that it is not selected.
  9. Carry out the actions you want to record.
  10. On the Stop Recording toolbar, click Stop Recording .

No comments:

Post a Comment