User form question

  • Thread starter Thread starter Gareth
  • Start date Start date
G

Gareth

I have a form, on it there are several Yes/No combo boxes.

If the user chooses No then I want another form to open with a comments box.
When this form is closed I would like the original form to be displayed and
the text entered into the comments box placed on a worksheet.

What would be the code for the combo box and the OK button on the second
form?

Thanks in advance.

Gareth
 
Gareth,

' Assuming the second UserForm is named UserForm2.....
Private Sub ComboBox1_Change()
UserForm2.Show
End Sub

' Assuming UserForm2 has a TextBox where you'll enter comments and
a CommandButton

Private Sub CommandButton1_Click()
Worksheets("yoursheetname").Range("A1").Value =TextBox1.Value
End Sub

If the text that's entered onto the worksheet needs to populate a textbox
or a label on UserForm1, then try
Private Sub CommandButton1_Click()
Worksheets("yoursheetname").Range("A1").Value =TextBox1.Value
Unload UserForm2
Unload UserForm1
UserForm1.Show
End Sub

John
 
Back
Top