Passing Parameters and Returning Values : Function Return « Language Basics « VBA / Excel / Access / Word






Passing Parameters and Returning Values

 
Sub cmdPassParameters_Click()
  Call Initials("First", "LastName")
End Sub

Sub Initials(strFirst As String, strLast As String)
  MsgBox "Your Initials Are: " & Left$(strFirst, 1) _
   & Left$(strLast, 1)
End Sub

 








Related examples in the same category

1.return value from user-defined function
2.Specifying the Data Type for a Function's Result
3.Return number from function
4.Return a string from funtion
5.Functions That Return an Array
6.Returning a sorted list