-
Solved: Returning TextBox data to msgbox or cell
Obviously, I'm fairly new to vba coding.
I've created a userform and added a textbox. I need to be able to close the textbox, but save the data from what was entered.
Unload will remove all from memory and screen, but I don't know what else to do or how to get the data stored to a variable.
-
Welcome to the forum!
You could set the ControlSource property value to say Sheet2!A1 or something like:
[VBA]Private Sub CommandButton1_Click()
Dim sVariable As String
sVariable = TextBox1.Value
Worksheets("Sheet1").Range("A1").Value = sVariable
Unload Me
End Sub[/VBA]
-
Cool, the control source did the trick. Thanks for the help, Ken.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules