I got this from someone here in the forums, but I forgot who gave it to me
Put a Public Function in the UserForm code and have it return data to the calling macro
Public Function Value_Ret( _
Optional strTitle As String = "My Custom Input", _
Optional strPrompt As String = "Enter Something", _
Optional vntDefault As Variant = vbNullString _
) As Variant
With Me
.Caption = strTitle
.lblPrompt.Caption = strPrompt
With .txtInput
.Value = vntDefault
.SelStart = 0
.SelLength = Len(vntDefault)
End With
.Show
If Len(.txtInput.Value) > 0 And Not .txtInput.Value = vntDefault Then
Value_Ret = .txtInput.Value
Else
Value_Ret = False
End If
End With
Unload frmInput
End Function
and call it like this, probably in a standard module
Option Explicit
Sub example02()
MsgBox frmInput.Value_Ret(, , "old text")
End Sub