PDA

View Full Version : UserForm ComboBox error



Jabba89
12-18-2014, 02:55 AM
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/q54/StegoKnight/Help%20Pics/Screenshot-12_17_201411_03_07AM_zps4096f19d.png

http://i133.photobucket.com/albums/q54/StegoKnight/Help%20Pics/Screenshot-12_17_201411_03_33AM_zpsb402d513.png Code1

http://i133.photobucket.com/albums/q54/StegoKnight/Help%20Pics/Screenshot-12_17_201411_03_39AM_zpsab68daf6.png Code2

Admin
12-18-2014, 07:31 AM
Hi

Welcome to board.

Please attach the workbook here. Click on Go Advanced and there is an option to attach the workbook.

Jabba89
12-18-2014, 08:24 AM
Here is the Excel file in whole .

1713

Admin
12-18-2014, 08:33 AM
Remove all the codes from the userform module and put this one.


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

Jabba89
12-20-2014, 03:54 AM
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.