• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

9. The Visual Basic Editor, Part II > 9.3. Creating a Procedure

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 9-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.

The Add Procedure dialog box
Figure 9-1. The Add Procedure dialog box

A simpler alternative is to begin typing:

SubSubName

or:

FunctionFunctionName

PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint