Thread: [Solved] Help with VBA userform
View Single Post
 
Old 03-02-2015, 10:43 AM
benn benn is offline Windows 7 64bit Office 2007
Novice
 
Join Date: Mar 2015
Posts: 1
benn is on a distinguished road
Default Help with VBA userform

Hello, so I am a student and I was asked to create a quiz for my IT project.
I wanted to add macros and so here is my problem.
When I click start, I want a user form to pop up and ask for the users name, and store the input in the variable UserId.
I have created the userform, and it works fine, but the variable doesn't seem to pick up what is written in the text box.
Here is my code for this specific section:
------------------------------------------------------------------------
Private Sub TextBox1_Change()
UserId = TextBox1.Text
End Sub

Private Sub ToggleButton1_Click()
MsgBox ("Thank you," & UserId)
End Sub
-------------------------------------------------------------------------
Currently, the Thank you, & user ID currently reads
Thank you,[BLANK]
Thanks in advance for any help
Kind regards, Benn
Reply With Quote