-
UserForm ComboBox error
I'm on my final assignment in my CIT class Office Application Development. I'm working on a
UserForm in Excel. For some reason the cboCategory isn't working. If any other mistakes could it be pointed out.
http://i133.photobucket.com/albums/q...ps4096f19d.png
http://i133.photobucket.com/albums/q...psb402d513.png Code1
http://i133.photobucket.com/albums/q...psab68daf6.png Code2
-
Hi
Welcome to board.
Please attach the workbook here. Click on Go Advanced and there is an option to attach the workbook.
-
1 Attachment(s)
Here is the Excel file in whole .
Attachment 1713
-
Remove all the codes from the userform module and put this one.
Code:
Private Sub cmdInsert_Click()
Dim intRow As Integer
intRow = Sheet1.UsedRange.Rows.Count + 1
Sheet1.Cells(intRow, "A") = txtItemName.Text
Sheet1.Cells(intRow, "B") = cboRoom.Text
Sheet1.Cells(intRow, "C") = cboCategory.Text
Sheet1.Cells(intRow, "D") = txtQuantity.Value
Sheet1.Cells(intRow, "E") = txtValue.Value
' txtName.Text = ""
' txtAddress.Text = ""
' txtCity.Text = ""
' cboState.Text = ""
' txtZip.Text = ""
End Sub
Private Sub UserForm_Initialize()
Dim vRoom As Variant, vCategory As Variant
vRoom = Array("Kitchen", "Living Room", "Bedroom", "Other")
vCategory = Array("Electronics", "Furniture", "China/Silverware", "Other")
cboRoom.List = vRoom
cboCategory.List = vCategory
End Sub
-
Thank you so much for the help. I feel a little shame as I could not get the assignment to work properly myself but with the deadline closing in I had no choice but to reach out for help. Hopefully I won't come to this forum for help often. Thanks again.