Userform Issues

sappster

New Member
Joined
Aug 24, 2011
Messages
9
I am having some Userform issues. I have 4 comboboxes on my userform. All are getting results from the previous combobox. 3 of them work, but I don't know how to get the last combobox to work. Also, I have a Frame with 2 optionbuttons but I cannot figure out the VBA code to write the optionbutton results to my spreadsheet. The comproduct, combescription, comcabinet, work, but not comchoose work. Below is some of my code:
Code:
Private Sub comdescription_Change()
Dim ceDes As Range: Dim wsDV As Worksheet
    comcabinet.Value = ""
    If comcabinet.ListCount >= 1 Then
        For n = 0 To comcabinet.ListCount - 1
            comcabinet.RemoveItem (0)
        Next n
    End If
    
    Set wsDV = Worksheets("DataValidation")
    Set ceDes = wsDV.Range("2027:2027").Find(comdescription.Text)
    r = 2027 + 1
    If Not ceDes Is Nothing Then
         Do Until wsDV.Cells(r, ceDes.Column) = ""
            comcabinet.AddItem wsDV.Cells(r, ceDes.Column)
            r = r + 1
         Loop
    End If
End Sub

Private Sub comproduct_Change()         ' Door Style ComboBox
'comproduct.RowSource = Sheets("DataValidation").Range("c2:c") & v
    Dim cePdt As Range: Dim wsDV As Worksheet
    comdescription.Value = ""
    If comdescription.ListCount >= 1 Then
        For n = 0 To comdescription.ListCount - 1
            comdescription.RemoveItem (0)
        Next n
    End If
    
    Set wsDV = Worksheets("DataValidation")
    Set cePdt = wsDV.Range("2003:2003").Find(comproduct.Text)
    r = 2003 + 1
    If Not cePdt Is Nothing Then
         Do Until wsDV.Cells(r, cePdt.Column) = ""
            comdescription.AddItem wsDV.Cells(r, cePdt.Column)
            r = r + 1
         Loop
    End If
End Sub
Private Sub comcabinet_Change()
Dim ceCab As Range: Dim wsDV As Worksheet
    comchoose.Value = ""
    If comchoose.ListCount >= 1 Then
        For n = 0 To comchoose.ListCount - 1
            comchoose.RemoveItem (0)
        Next n
    End If
    Set wsDV = Worksheets("DataValidation")
    Set ceCab = wsDV.Range("2038:2038").Find(comcabinet.Text)
    r = 2038 + 1
End Sub

Private Sub cmdenter_Click()
ActiveWorkbook.Sheets("DataGatheringAllocation").Activate
    Range("c9").Select
    Do
    If IsEmpty(ActiveCell) = False Then
        ActiveCell.Offset(1, 0).Select
    End If
    Loop Until IsEmpty(ActiveCell) = True
    ActiveCell.Value = comproduct.Value
    ActiveCell.Offset(0, 1) = comdescription.Value
    ActiveCell.Offset(0, 2) = comcabinet.Value
    ActiveCell.Offset(0, 3) = comchoose.Value
    ' ActiveCell.Offset(0, 4) =
    ActiveCell.Offset(0, 9) = txtPurPr.Value
    ActiveCell.Offset(0, 10) = txtSupCp.Value
    ActiveCell.Offset(0, 19) = comwarehouse.Value
    ActiveCell.Offset(0, 20) = comwcustomer.Value
    
    Me.comproduct.Value = ""
    Me.comdescription.Value = ""
    Me.comcabinet.Value = ""
    Me.comchoose.Value = ""
    ' Me.Hinging.Value = ""
    Me.txtPurPr.Value = ""
    Me.txtSupCp.Value = ""
    Me.comwarehouse.Value = ""
    Me.comwcustomer.Value = ""
    Me.comproduct.SetFocus
End Sub
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.

Forum statistics

Threads
1,224,518
Messages
6,179,254
Members
452,900
Latest member
LisaGo

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top