Microsoft Office Tutorials and References
In Depth Information
4.2 Getting Help
4.2 Getting Help
If you are like me, you will probably make extensive use of Microsoft's Excel VBA help files
while programming. The simplest way to get help on an item is to place the cursor on that item
and hit the F1 key. This works not only for VBA language keywords but also for portions of the
VBA IDE.
Note that Microsoft provides multiple help files for Excel, the VBA language, and the Excel
object model. While this is quite reasonable, occasionally the help system gets a bit confused and
refuses to display the correct help file when we strike the F1 key. (I have not found a simple
resolution to this problem, other than shutting down Excel and the Visual Basic Editor along with
it.)
Note also that a standard installation of Microsoft Office does not install the VBA help files for
the various applications. Thus, you may need to run the Office setup program and install Excel
VBA help by selecting that option in the appropriate setup dialog box. (Do not confuse Excel help
with Excel VBA help.)
4.3 Creating a Procedure
There are two ways to create a new procedure (that is, a subroutine or a function) within a code
module. First, after selecting the correct project in the Project Explorer, we can select the
Procedure option from the Insert menu. This will produce the dialog box shown in Figure 4-1 . Just
type in the name of the procedure and select Sub or Function (the Property choice is used with
custom objects in a class module). We will discuss the issue of public versus private procedures
and static variables later in this chapter.
Figure 4-1. The Add Procedure dialog box
A simpler alternative is to simply begin typing:
Sub SubName
or:
 
 
 
Search JabSto ::




Custom Search