|

How to Get Help in the Excel Visual Basic Editor

At this point, you might be wondering, “What if I get stuck?”  Fear not, help is at hand!  Microsoft offers extensive online documentation of the VB language.  To be fair and warn you, it’s often not that useful.  You might find more assistance if you Google for your topic.  There is a lot of programming advice, of mixed quality, on the internet.  There is even this website that you are reading now.

That said, this is what Microsoft offers:

1.     Context-Sensitive Help

While in code, click or double-click on any statement you would like to find out more about.  Press F1 for Visual Basic Help:

In Excel 2013 and later, the Help appears on a web page as shown below.  You may have to log on to your Microsoft account first.  No internet?  Don’t expect sympathy from Microsoft.

As with any other web page, you will find links to other topics, and you can Print.

Scroll down for an Example (if you are lucky).  Unfortunately, Microsoft seems to make its so-called “Help” less helpful with each new release.

2.     The Object Browser

If you are not on the internet, or just need some short help, there is another possibility.  You can find VBA built-in functions, commands, methods and objects listed in the Object Browser.

Press F2: The window shown below will open inside the code window.

  1. In the dropdown list at the top left, where it says “<All Libraries>”, choose “VBA”.
  2. In the left-hand window pane, click on the category of item you want, for example, “Interaction” as below.  This can be “hit-and-miss” until you learn your way around.
  3. The right-hand window pane will show the items in that category.  Click on the item you want, for example, “MsgBox” as below.
  4. Note the syntax given at the bottom. For more help, click the lower “?” button (ringed in the picture).

To close the Object Browser, click the second “X” from the top on the extreme right of the Visual Basic Editor window.  Or press Ctrl+F4.

3.     Automatic Help

Another kind of Help in the Visual Basic Editor is the context-sensitive help you will get on certain statements as you type:

Remember the settings in Tools > Options > Editor?

Auto List Members — Displays choices available to complete the statement at the current insertion point.

Auto Quick Info — Displays information about functions and their parameters.

Auto Data Tips – In break mode, point at a variable in the current context.  A tool tip will display the value of that variable, for example, “Name1$” here:

Fine, but what is a “variable”?  What is “MsgBox”?  To explain the latter first, in the next post, we will look at the Built-in Functions in Visual Basic.

Similar Posts