VBA - Textbox as caption

becklog

New Member
Joined
Dec 26, 2016
Messages
38
Hi,

I have a userform with several textboxes and a submit button.
My goal is to show a summary box of all entered data when the submit button is clicked.


Below is the code that I have but is not working. Thanks for the help!


Private Sub CommandButton1_Click()
Summary.Show
End Sub


then

---summary form---


Private Sub userform_initialize()
LawsonCon2.Caption = Lawsonbox.Value
End Sub
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
Try:

Code:
Private Sub userform_initialize()
   LawsonCon2.[B][COLOR=#800080]Caption [/COLOR][/B]= [B][COLOR=#0000ff]Userform1[/COLOR][/B].Lawsonbox.Value 'change Userform1 by the name of your userform that contains the textbox
End Sub



LawsonCon2 is a textbox or a label?

If it is a label then it is correct to use .Caption, if it is a textbox then you must use .Value

If you do not want the editable textbox then:

Code:
Private Sub userform_initialize()
    LawsonCon2.Enabled = False
    'or
    LawsonCon2.Locked = True
    '
    LawsonCon2.Value = UserForm1.Lawsonbox.Value 
End Sub
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,898
Messages
6,175,274
Members
452,628
Latest member
dd2

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top