Let us make the first macro very simple to begin with. I will guide you now, through the steps to create a macro that makes the text of a cell bold, italics and underlined. Three operations at one go.
Procedure:
- Select a Blank Cell
- Click on Tools-LMacro->Record New Macro.
[At this point a small window opens up. In this window, - Name your macro
[Your macro should always have a meaningful name so that you can recognise it from the others you may create] - Define a Shortcut Key for the Macro
[Note: This shortcut key supercedes all other shortcut keys in excel as long as the Macro is active. For example, if you assign Ctrl-B to this macro, pressing Ctrl-B will only call this Macro. You therefore lose the ability to use Ctrl-B for Bold. My rule of Thumb is to use Ctrl-Shift-() for Macros] - Define whether you want this macro available ony for the present workbook or globally. If you want it for every workbook, choose to store it in Personal Macro Workbook
- Give a brief description if required.
[Now you will notice a small toolbar come up on the screen with just two buttons. One button stops the macro. The other is for relative references that we shall explore later.] - Click on the ‘Bold’, ‘Italic’ and ‘Underline’ buttons on the excel toolbar.
- Click on the ‘Stop Recording’ Button.
You are now done!
To test it, select another cell and type something into it. Now use the shortcut key that you defined while creating the macro. and voila! you have bold, underlined and italicized text.