| 
    
     |  | こんばんわ。 
 ユーザーフォームのプロパティを自作したらどーでっか?
 ↓こんなの(UserForm1にTextBox1とcmdOK・cmdCancelの2個のボタンを配置)
 
 <フォームモジュール>
 Public Canceled As Boolean
 
 Public Property Get TxtValue() As String
 TxtValue = Me.TextBox1.Value
 End Property
 
 Private Sub cmdCancel_Click()
 Me.Hide
 End Sub
 
 Private Sub cmdOK_Click()
 Canceled = False
 Me.Hide
 End Sub
 
 Private Sub UserForm_Initialize()
 Canceled = True
 End Sub
 
 <標準モジュール>
 Sub test()
 Dim TargetValue As String
 
 Load UserForm1
 With UserForm1
 .Show
 If Not .Canceled Then
 TargetValue = .TxtValue
 MsgBox TargetValue
 End If
 End With
 Unload UserForm1
 Set UserForm1 = Nothing
 End Sub
 
 試してみてな。
 ほな。
 
 |  |