What You Can Do with VBA Macros
VBA is an extremely rich programming language with thousands of uses. The following list contains just a few things that you can do with VBA macros.
Insert a text string or formula:
If you need to enter your company name into worksheets frequently, you can create a macro to do the typing for you. The AutoCorrect feature can also do this.
Automate a procedure that you perform frequently:
For example, you may need to prepare a month-end summary. If the task is straightforward, you can develop a macro to do it for you.
Automate repetitive operations:
If you need to perform the same action in 12 different workbooks, you can record a macro while you perform the task once-and then let the macro repeat your action in the other workbooks.
Create a custom command:
For example, you can combine several of Excel's menu commands so that they are executed from a single keystroke or from a single mouse click.
Create a custom toolbar button:
You can customize Excel's toolbars with your own buttons to execute macros that you write.
Create a simplified "front end" for users who don't know much about Excel:
For example, you can set up a foolproof data entry template.
Develop a new worksheet function:
Although Excel includes a wide assortment of built-in functions, you can create custom functions that greatly simplify your formulas.
Create complete, turnkey, macro-driven applications:
Excel macros can display custom dialog boxes and add new commands to the menu bar.
Create custom add-ins for Excel:
Most of the add-ins that are shipped with Excel were created with Excel macros.