Umm ecaal statement???
OK, see if this helps.
Dim nValue1 as Integer
Dim nValue2 as Integer
Dim nResult as Integer
nValue1 = 5
nValue2 = 10
nResult = AddValues(nValue1, nValue2)
Function AddValues(Paramater1 as Integer, Parameter2 as Integer) as Integer
AddValues = Parameter1 + Parameter2
Return AddValues
End Function
Msgbox "The Result is: " nResult
The values are passed to the procedure by Calling the AddValues Function, which accepts to arguements (or parameters).
1. ByVal is used when you don't want the procedure (function) to modify the variable that is passed to the procedure through an arguement.
2. ByRef is ued when you want to allow the procedure to modify the variable that is passed to the procedure.
Hope this helps