(a)
Public Sub ChangeString(shString as String)
   If i = 0 Then    
ShString = "Change the String"
   End if
End Sub

(b)
Public Sub ChangeString(ByRef shString as String)
    If i = 0 Then   
ShString = "Change the String"
    End if
End Sub

Example 3: The ByVal and ByRef parameters.

Back to Article