
Originally Posted by
RhinoBull
That isn't necessary at all
I beg to differ.......
Using VBA in Excel (for example)
Given you have a UserForm and a TextBox (TextBox1) and CommandButton (CommandButton1)
Code:
Private Sub MYSub(txt As TextBox)
MsgBox txt.Name
End Sub
Private Sub CommandButton1_Click()
Call MYSub(TextBox1)
End Sub
Results in "Type Mismatch", on the call, whereas
Code:
Private Sub MYSub(txt As msforms.TextBox)
MsgBox txt.Name
End Sub
Private Sub CommandButton1_Click()
Call MYSub(TextBox1)
End Sub
results in the MsgBox being displayed.