Hi,

I have created a userform that allows users to enter data into a database spreadsheet. When I run a macro called showUserForm from the macro menu or from inside VBA the userform opens and runs properly.

Sub showUserform()
UserForm1.Show
End Sub
However, I would like users to be able to open the userform from excel with the click of a button, without having to goto the macro menu, or press a combination of keys. When I add a command button to the worksheet I get a RTE 13 'type mismatch' when trying to open the user form. I have tried changing the name of the command buttons in the sheet and in the user form so they don't conflict but am having no luck. Any ideas?

Here is the code for the button in the worksheet:
Private Sub CommandButton10_Click()
UserForm1.Show ' Have also used showUserForm here as well
End Sub
and from the userform:
Private Sub userform_initialize()

Sheets("Raw Data").Select
' Select Test Type
For i = 2 To 8
    UserForm1.ComboBox1.AddItem (Sheets("User Form Data").Cells([i], [1]).Text)
Next i
' Select Sample Type
For i = 2 To 7
    UserForm1.ComboBox2.AddItem (Sheets("User Form Data").Cells([i], [2]).Text)
Next i
' Select Pond Number
For i = 2 To 6
    UserForm1.ComboBox3.AddItem (Sheets("User Form Data").Cells([i], [3]).Text)
Next i

' Count the number of entries in the sheet
Cells([2], [2]).Select
Range(Selection, Selection.End(xlDown)).Select
rowe = Selection.Rows.Count
UserForm1.ScrollBar1.Max = rowe + 1
End Sub
Thanks!