A complete Excel VBA keywords list is not a single built-in feature—you must compile it yourself from the language reference, the Object Browser, or Microsoft's documentation. The quickest way is to open the Visual Basic Editor (Alt+F11), press F2 to open the Object Browser, and browse the VBA library; for a printable list, export the keywords you find into a worksheet using a short macro. This guide walks you through building and maintaining your own keyword reference so you can write macros faster and with fewer syntax errors.
What You'll Need
- Excel with macros enabled (any desktop version; the steps below use the Windows desktop interface—Mac menus differ slightly).
- Basic familiarity with the Visual Basic Editor (VBE), which you open with Alt+F11 on Windows or Fn+Option+F11 on Mac.
- Permission to save a macro-enabled workbook (.xlsm) if you want to keep your keyword list.
Step-by-Step
- Open the Visual Basic Editor. In Excel, press Alt+F11 (Windows) or Fn+Option+F11 (Mac). The VBE opens in a separate window. Menu labels can differ slightly by version, device, and region.
- Open the Object Browser. In the VBE, press F2 or choose View > Object Browser. This is the authoritative in-app reference for every object, method, property, event, and constant available to your project.
- Filter to the VBA library. In the Object Browser's library dropdown (usually labeled <All Libraries>), select VBA. This narrows the list to core language items such as Debug, Err, and Collection.
- Search for a keyword. Type a term in the search box and press Enter. The results pane lists matching members; click one to see its definition, arguments, and the library it belongs to in the bottom pane.
- Record keywords into a worksheet. Back in Excel, insert a new worksheet and name it Keywords. In the VBE, insert a module (Insert > Module) and paste a short macro that writes a list of terms into that sheet. For example, a loop that writes each term from an array to column A. Run it with F5. This gives you a editable, sortable list.
- Expand the list from Microsoft documentation. Microsoft's VBA language reference lists statements, functions, and keywords by category. Copy the categories you need into your worksheet, one term per row, and add a column for a short description in your own words.
- Add a category column. In your worksheet, add columns for Category (e.g., Statement, Function, Object, Constant), Syntax example, and Notes. This turns a flat list into a study aid.
- Use the list while coding. Keep the workbook open beside your macro workbook. When you are unsure of a keyword, search your list first, then confirm the exact syntax in the Object Browser—your list is a memory aid, not a substitute for the reference.
- Save and back up. Save as .xlsm. Because the list is your own work, keep a copy in cloud storage or version control so you do not lose it.
Common Mistakes
- Confusing keywords with objects. Words like Range and Worksheet are objects, not keywords; the Object Browser distinguishes them by library and type.
- Assuming the list is exhaustive. The VBA library is large, and some items are hidden or version-specific. Treat any list as a starting point.
- Typing keywords from memory without checking syntax. VBA is strict about argument order and required parentheses; always confirm in the Object Browser.
- Saving as .xlsx. Macros are stripped from standard workbooks; use .xlsm.
- Trusting third-party lists blindly. Some include deprecated or non-VBA terms; cross-check against Microsoft's documentation.
Tips
- Use the Object Browser's search with “Show Hidden Members” enabled only when you need to; hidden members are not intended for general use.
- Add a column for “Seen in” (e.g., a specific project) so you remember context.
- Keep a short “top 20” sheet of keywords you use daily for quick access.
- Use Excel's filter and sort on your keyword sheet to group by category.
- When you learn a new keyword, add it immediately—lists decay if not maintained.
Troubleshooting
- The Object Browser shows nothing for a search. Check the library filter; you may be searching a single library that does not contain the term. Set it to <All Libraries>.
- Your macro to export keywords fails. Ensure macros are enabled and the workbook is saved as .xlsm. Check that the target sheet name matches exactly.
- Keywords behave differently than expected. Some keywords are context-dependent (e.g., inside a With block). Verify scope and the active object.
- You cannot find a keyword you saw online. It may belong to a different library (e.g., Excel, Office) or be a user-defined name. Confirm the source.
- The VBE is not available. On some managed or Mac systems, the VBE may be restricted; contact your administrator.
Frequently Asked Questions
Is there an official Excel VBA keywords list?
Microsoft publishes a language reference covering statements and functions, but there is no single downloadable “keywords list” file. The Object Browser is the authoritative in-app source.
What is the difference between a keyword and a function in VBA?
Keywords are reserved words that form the language's syntax (e.g., If, For, Dim). Functions are procedures that return a value (e.g., MsgBox, Len). Some words, like Set, are statements rather than functions.
Can I use these keywords in Excel formulas?
No. VBA keywords are for macros only; worksheet functions use a different syntax and set of names.
Why do some keywords appear in the Object Browser but not in my code?
They may be hidden members or belong to a library not referenced by your project. You can add references via Tools > References in the VBE.
How do I find the keyword for a specific action?
Search the Object Browser by likely object or method name, or record a macro performing the action and inspect the generated code.
Are VBA keywords case-sensitive?
No, VBA is not case-sensitive, but the editor auto-capitalizes recognized keywords for readability.