What Is Visual Basic for Applications (VBA)?

Visual Basic for Applications (VBA) is part of Microsoft Corporation's (NASDAQ: MSFT) legacy software, Visual Basic, which the company built to help write programs for the Windows operating system. Visual Basic for Applications runs as an internal programming language in Microsoft Office (MS Office, Office) applications such as Access, Excel, PowerPoint, Publisher, Word, and Visio.

VBA allows users to customize beyond what is normally available with MS Office host applications—VBA is not a stand-alone program—by manipulating graphical-user-interface (GUI) features such as toolbars and menus, dialogue boxes, and forms. You may use VBA to create user-defined functions (UDFs), access Windows application programming interfaces (APIs), and automate specific computer processes and calculations.

More About Visual Basic for Applications

VBA is an event-driven tool; which means that you can use it to tell the computer to initiate an action or string of actions. To do this, you build custom macros—short for macroinstructions—by typing commands into an editing module. A macro is essentially a sequence of characters whose input results in another sequence of characters (its output) that accomplishes specific computing tasks. You do not need to purchase the VBA software because VBA is the version of Visual Basic that ships with Microsoft Office 2010.

[Important: Visual Basic for Applications is the only version of VB 6 that is still sold and supported by Microsoft and only as an internal component of Office programs.] 

How Is VBA Used?

For most of us

Within MS Office applications, Visual Basic for Applications allows users to perform myriad functions that go beyond simple word processing and spreadsheet functions. For the typical user, VBA helps to make frequent everyday tasks less repetitive via macros. Macros can automate just about any task—like generating customized charts and reports, and performing word- and data-processing functions. For example, you can write a macro that, with a single click, will make Excel create an entire balance sheet from a series of accounting entries in a spreadsheet.

For computer professionals

Programmers, however, use macros in more complex ways—like replicating large pieces of code, merging existing program functions, and designing specific languages.

For companies and organizations

VBA can also work in external—that is, non-Microsoft—settings by using a technology called "COM interface," which allows commands to interact across computer boundaries. Many firms have implemented VBA within their own applications, both proprietary and commercial—including AutoCAD, ArcGIS, CATIA, Corel, raw, and SolidWorks.

Any firm may use VBA to customize Excel for a unique purpose, such as discerning how long it would take to earn $1 million in an investment portfolio based on a specific interest rate and other factors, like the number of years until retirement.

Key Takeaways

  • Visual Basic for Applications is a computer programming language developed and owned by Microsoft.
  • With VBA you can create macros to automate repetitive word- and data-processing functions, and generate custom forms, graphs, and reports.
  • VBA functions within MS Office applications; it is not a standalone product.

Example—VBA and the Financial Markets

Visual Basic for Applications is ubiquitous in finance

At its core, finance is about manipulating huge amounts of data; hence, VBA is endemic to the financial services sector. If you work in finance, then VBA likely is running within applications that you use each day, whether you're aware of it or not. Some jobs in the sector require prior knowledge of VBA, and some do not. Either way, if you want to pursue a career in finance, it is important that you know the latest technological trends in your domain, and how to use automation in your day-to-day activities. Because VBA is user-intuitive, those with little or no computer programming knowledge can learn it easily.

Some ways that finance professionals use VBA

  • Macros allow financial professionals—whether accountants, commercial bankers, investment bankers, research analysts, salesmen, traders, portfolio managers, clerks, or administrators—to analyze and adjust huge amounts of data quickly.
  • You can use VBA in Excel to create and maintain complex trading, pricing, and risk-management models; forecast sales and earnings, and generate financial ratios.
  • With Visual Basic for Applications, you can create various portfolio-management and investment scenarios.
  • You also may use VBA to generate lists of customers’ names or any other content; create invoices, forms, and charts; analyze scientific data, and manage data display for budgets and forecasting.