Results 1 to 5 of 5

Thread: UserForm ComboBox error

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Junior Member
    Join Date
    Dec 2014
    Posts
    3
    Rep Power
    0

    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
    Last edited by Jabba89; 12-18-2014 at 03:23 AM.

  2. #2
    Administrator Admin's Avatar
    Join Date
    Mar 2011
    Posts
    1,123
    Rep Power
    10
    Hi

    Welcome to board.

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

    Excel Range to BBCode Table
    Use Social Networking Tools If You Like the Answers !

    Message to Cross Posters

    @ Home - Office 2010/2013/2016 on Win 10 (64 bit); @ Work - Office 2016 on Win 10 (64 bit)

  3. #3
    Junior Member
    Join Date
    Dec 2014
    Posts
    3
    Rep Power
    0
    Here is the Excel file in whole .

    Office Application Development Final.xlsm

  4. #4
    Administrator Admin's Avatar
    Join Date
    Mar 2011
    Posts
    1,123
    Rep Power
    10
    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
    Cheers !

    Excel Range to BBCode Table
    Use Social Networking Tools If You Like the Answers !

    Message to Cross Posters

    @ Home - Office 2010/2013/2016 on Win 10 (64 bit); @ Work - Office 2016 on Win 10 (64 bit)

  5. #5
    Junior Member
    Join Date
    Dec 2014
    Posts
    3
    Rep Power
    0
    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.

Similar Threads

  1. Difference Between 'On Error GoTo 0' And 'On Error GoTo -1'
    By Transformer in forum Familiar with Commands and Formulas
    Replies: 7
    Last Post: 07-02-2015, 04:07 PM
  2. changing code from using Combobox to optionbuttons
    By paul_pearson in forum Excel Help
    Replies: 24
    Last Post: 09-05-2013, 12:59 PM
  3. Replies: 8
    Last Post: 08-17-2013, 04:03 AM
  4. adding entries into combobox with code
    By paul_pearson in forum Excel Help
    Replies: 1
    Last Post: 07-23-2013, 01:01 PM
  5. Combobox with Dynamic Date Range
    By paul_pearson in forum Excel Help
    Replies: 5
    Last Post: 07-21-2013, 06:14 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •