Visual Basic for Applications (VBA)
VBA is a scripting language that is used to automate tasks in Microsoft software such as Word, Excel and PowerPoint. VBA’s syntax is similar to that of Visual Basic (VB).
VBA lets you write macros that automate repetitive tasks, which you would otherwise waste lots of time doing manually.
For example, suppose that you frequently need to format a Word document for a newsletter: switch it to two columns, change the font, add a header, and the like. You could program all of this into a VBA routine, and at the press of a button have the computer do it all for you.
VBA also lets you create your own programs that use Microsoft applications’ functionality. For instance, we have created a program that, with one click, creates images of each slide in a PowerPoint presentation and then formats them for use on the Web.
When VBA is needed, there are generally no easy alternatives, so discussion of disadvantages is moot.
When to Choose VBA
When you need to automate tasks in Microsoft software.