Recording a Macro

If you are not sure whether you have a personal.xls, you can let Excel record a macro in your personal.xls. If you don't have one then Excel will create a personal.xls workbook for you in the XLSTART directory which is in the same directory as you are running Excel.exe from.


Use ready pre-written Macros

Instead of recording your own macro, install a macro from a newsgroup, or from a web page. Bring up VBE, within the Project Explorer select your project, which is your workbook name.  You will install the provided macro in your workbook, or if you want the macro to always be accessible you would install in your personal.xls workbook.

If you do not see modules in your VBAProject (personal.xls) or another project workbook which you've selected, then invoke the menu Insert ->Module [see sample] or right-click on your VBAProject (personal.xls) in the Project Explorer [see sample]. The first module created in a project would be module1. You can rename it. You can put several macros in a module or create a new module for some addition macros. 

Double-click on the selected module name. Copy code (Ctrl+C) from your source then paste (Ctrl+V) the code into a standard module that you just picked. Next, run your macro but keep in mind when you use a macro, you can not undo with Ctrl+Z the result that is done.


Run your Macro


Press Alt+F8, select the macro you installed and click the [Run] button.

Why my macro does not run?