Although you haven't declared the variable (and you should) PowerPoint will assume it to be declared in the Private sub. Because it is private to this sub only it cannot be used elsewhere.
Declare it like this
'Outside iof the private sub
Dim UserID As String
Private Sub TextBox1_Change()
UserID = TextBox1.Text
End Sub
Private Sub ToggleButton1_Click()
MsgBox ("Thank you," & UserID)
End Sub
|