mercredi 4 février 2015

How to return name of parameter in VBA

Does anyone have an idea how to return parameter name in VBA?


This is what I have:



Sub Main()
Dim MyString As String
MyString = "Hello World"
MsgBox MyString
End Sub


It shows only "Hello World". I would like to have it "MyString says Hello World", but dynamically, not by entering



MsgBox "MyString says " & MyString


I would prefer something like



MsgBox ParamName(MyString) & " says " & MyString


but it actually won't work... Could anyone help?






Aucun commentaire:

Enregistrer un commentaire