harveya915
Board Regular
- Joined
- Sep 4, 2015
- Messages
- 141
I have a UserForm with TextBoxes (1-4), kind of like answers to questions. Then I have a CommandButton that when clicked inputs the contents from the TextBoxes (1-4) to another TextBox (5) along with some other auto generated text.
I would like to add a checkbox to the UserForm that if checked will add a few more words to TextBox5.
This is the code I have:
I hope I did a good job explaining what I need, if not, please feel free to ask.
Much thanks for any help.
I would like to add a checkbox to the UserForm that if checked will add a few more words to TextBox5.
This is the code I have:
VBA Code:
Private Sub UserForm1_Initialize()
TextBox1.Value = ""
TextBox2.Value = ""
TextBox3.Value = ""
TextBox4.Value = ""
TextBox5.Value = ""
End Sub
Private Sub CommandButton1_Click()
TextBox5.Value = "Random Text 1 in Text box 5" & TextBox1.Text & vbNewLine & "Random Text 2 in Text box 5" & TextBox2.Text & vbNewLine & "Random Text 3 in Text Box 5" & TextBox3.Text & vbNewLine & "Random Text 4 in Text Box 5" & TextBox4.Text
End Sub
Private Sub CommandButton3_Click()
Unload UserForm1
End Sub
I hope I did a good job explaining what I need, if not, please feel free to ask.
Much thanks for any help.