byval by ref vba code example
Example: vba byref byval
Sub TestMe()
Dim sString As String
sString = "Initial value"
Call EstimVal(sString)
Debug.Print sString
sString = "Initial value"
Call EstimRef(sString)
Debug.Print sString
sString = "Initial value"
EstimRef (sString)
Debug.Print sString
sString = "Initial value"
Call EstimRef((sString))
Debug.Print sString
End Sub
Function EstimVal(ByVal pVar As String)
pVar = "ByVal"
End Function
Function EstimRef(ByRef pVar As String)
pVar = "ByRef"
End Function