I have a different take on the OP's question.
You can pass variables ByRef or ByVal and have them updated and returned in the called routine.
Sub Main()
Dim strA As String
Dim lngB As Long
strA = "Hello "
lngB = 5
MsgBox strA & " " & lngB, , "Before Call"
Call MySubByRef(strA, lngB)
MsgBox strA & " " & lngB, , "After Call using ByRef"
Call MySubByVal(strA, lngB)
MsgBox strA & " " & lngB, , "After Call using ByVal"
End Sub
Sub MySubByVal(ByVal Text As String, ByVal Number As Long)
Text = "Goodbye "
Number = Number * 5
End Sub
Sub MySubByRef(Text As String, Number As Long)
Text = "Goodbye "
Number = Number * 5
End Sub
Bookmarks