Microsoft Office Tutorials and References
In Depth Information
Passing Arguments to Procedures
This method can be quite useful when you’re developing a procedure because you can insert
commands to display results in the Immediate window. The following procedure demonstrates
this technique:
Sub ChangeCase()
Dim MyString As String
MyString = “This is a test”
MyString = UCase(MyString)
Debug.Print MyString
End Sub
Figure 9-5 shows what happens when you enter ChangeCase in the Immediate window: The
Debug.Print statement displays the result immediately.
Figure 9-5: Executing a procedure by entering its name in the Immediate window.
Passing Arguments to Procedures
A procedure’s arguments provide it with data that it uses in its instructions. The data that’s
passed by an argument can be any of the following:
h A variable
h A constant
 
Search JabSto ::




Custom Search