Dr.Evil925
New Member
- Joined
- Feb 24, 2011
- Messages
- 22
I am trying to get 2 combo box's. The first one should populate with a list of headers and the second with the entries under the header picked in box 1.
Here is what i have so far and box 1 works but box 2 does not.
Private Sub CBName_Drop Button Click()
For Customer = 1 To 50
If Cells(1, Customer).Value = CBCustomer.Value Then
For Each NName In ws.Range("A2:A10")
With Me.CBName
.AddItem NName.Value
End With
Next NName
End If
Next Customer
End Sub
Private Sub UserForm_Initialize()
Dim Cust As Range
Dim ws As Worksheet
Set ws = Worksheets("Account DB")
For Each Cust In ws.Range("A1:M1")
With Me.CBCustomer
.AddItem Cust.Value
End With
Next Cust
The sheet might look like this.
Cust1 Cust2
Jim George
My end result would be for box 1 to show Cust1, and Cust2. with box 2 showing Jim, or George depending on which Cust i pick
Thanks
Here is what i have so far and box 1 works but box 2 does not.
Private Sub CBName_Drop Button Click()
For Customer = 1 To 50
If Cells(1, Customer).Value = CBCustomer.Value Then
For Each NName In ws.Range("A2:A10")
With Me.CBName
.AddItem NName.Value
End With
Next NName
End If
Next Customer
End Sub
Private Sub UserForm_Initialize()
Dim Cust As Range
Dim ws As Worksheet
Set ws = Worksheets("Account DB")
For Each Cust In ws.Range("A1:M1")
With Me.CBCustomer
.AddItem Cust.Value
End With
Next Cust
The sheet might look like this.
Cust1 Cust2
Jim George
My end result would be for box 1 to show Cust1, and Cust2. with box 2 showing Jim, or George depending on which Cust i pick
Thanks