excel-vba Tutorial

Microsoft Excel includes a comprehensive macro programming language called VBA. This programming language provides you with at least three additional resources:

  1. Automatically drive Excel from code using Macros. For the most part, anything that the user can do by manipulating Excel from the user interface can be done by writing code in Excel VBA.
  2. Create new, custom worksheet functions.
  3. Interact Excel with other applications such as Microsoft Word, PowerPoint, Internet Explorer, Notepad, etc.

VBA stands for Visual Basic for Applications. It is a custom version of the venerable Visual Basic programming language that has powered Microsoft Excel’s macros since the mid-1990s.

IMPORTANT
Please ensure any examples or topics created within the excel-vba tag are specific and relevant to the use of VBA with Microsoft Excel. Any suggested topics or examples provided that are generic to the VBA language should be declined in order to prevent duplication of efforts.

  • on-topic examples:

    Creating and interacting with worksheet objects
    The WorksheetFunction class and respective methods
    Using the xlDirection enumeration to navigate a range

  • off-topic examples:

    How to create a ‘for each’ loop
    MsgBox class and how to display a message
    Using WinAPI in VBA