Pass string value through Parameters
Function fullName(strFname As String, strLName As String) As String
Dim strFirstName As String
Dim strLastName As String
Dim strFullName As String
strFirstName = strFname
strLastName = strLName
strFullName = strFirstName & " " & strLastName
fullName = strFullName
End Function
Sub getName()
Dim strFirstName As String
Dim strLastName As String
Dim strFullName As String
strFirstName = "First"
strLastName = "Last"
strFullName = fullName(strFirstName, strLastName)
msgBox strFullName, , "Full Name"
End Sub
Related examples in the same category