View Single Post
 
Old 12-17-2017, 07:01 AM
Larry_1 Larry_1 is offline Windows 10 Office 2010 64bit
Novice
 
Join Date: Dec 2017
Posts: 9
Larry_1 is on a distinguished road
Default Assigning a string variable to a userform label caption

I a beginner with Excel.

I've created UserForm1 with 3 labels and 3 textboxes (email, first name, last name), captured the entries and validated them. I then wanted to use those values as captions in UserForm 2. But I couldn't make UserForm2 work. So I created a simple test form to try it, and couldn't make that work either. I've tried both a hard coded string and a simple string variable. Neither worked. I placed this code in the VBA area attached to the UserForm.

I would sincerely appreciate any suggestions that you can offer.

Very respectfully,
Larry


Code:
Private Sub UserForm_Click()

    Dim strTestValue As String
    
    strTestValue = "This is the test value"
    Label1.Caption = strTestValue
    'Label1.Caption = "This is the soft entered Msg"
    'Me.Label1.Caption = strTestValue
    
    End Sub
Reply With Quote