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

Chapter 4. Using Procedures > Passing Arguments

Passing Arguments

So far, the procedures that you’ve seen do the exact same thing every time that they’re executed. But that doesn’t have to be the case. You can use a procedure argument to pass information to a procedure. When you define a procedure (by using either the Sub keyword or the Function keyword), you can also specify a list of arguments that the procedure will accept. Here’s a sub procedure that accepts a single integer argument:

Sub Procedure14(intInput As Integer)
  ' Double the input argument and print the result
  Debug.Print (intInput * 2)
End Sub


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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