Hi Brian,
"it shows up as a seperate screen" - yes it will do. It is a seperate object
and not a worksheet.
This is the principle...
Your first sub is fine as it is:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
UserForm1.Show
End Sub
Next, you need to add code to the form itself - in the
VB window right click
the form and "view code" - paste this in:
Private Sub UserForm_Initialize()
with me.combobox1
.additem "a"
.additem "b"
.additem "c"
end with
End Sub
(You need to have the form open to add items to the combo boxes, which is
why you do the adding in the initialise event)
Finally, add a command button "OK" to the form - this will populate the
sheet when the user clicks it. You can right click the button in the
VB
window and add the following code:
Private Sub CommandButton1_Click()
Application.EnableEvents = False
Worksheets("Sheet1").Range("A1").Value = Me.combobox1.Value
'etc
Application.EnableEvents = True
Unload Me
End Sub
Hope that gets you started.
Sam
"Brian" wrote:
I have a user Form that has several Text Boxes & Combo Boxes. From this Form
I want the user to Input Data and have it placed through out the rest of the
workbook.
I got the User Form to show up when you click a cell on the worksheet, but
for some reason it shows up as a seperate screen and not as sheet 1. The name
of the sheet I want it as is named "Data Input".
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
UserForm1.Show
End Sub
How can I get the Text and Combo Box on the user form to to fill in the
worsheet. Also How can I added the different choices to the combo box?
I tried, but it did not work for some reason.
With UserForm1.ComboBox1
.AddItem "a"
.AddItem "b"
.AddItem "co"
End With