Hi Everyone
I have a user form that has a combo box with 3 selections (18,21,25) Customer numbers.
I have another combo box that has a product list of around 80 items the problem is not all customers carry all the products. what I am trying to do is something like if customer = 18 then ws.(column P) <>"" then populate a combo box(I_List1) with 2 other ranges (GDR,Greg) and do this for each customer number.
customers
18 = Column P
21 = Column T
25 = Column X
I am using excel 2007
ws is another workbook that has the product list and each customer
below is the code I have that does not work.
I am using DropButt******* because it made sense to me if there is a better way please put me on the right path.
any help on this would be great
Thanks
Greg
I have a user form that has a combo box with 3 selections (18,21,25) Customer numbers.
I have another combo box that has a product list of around 80 items the problem is not all customers carry all the products. what I am trying to do is something like if customer = 18 then ws.(column P) <>"" then populate a combo box(I_List1) with 2 other ranges (GDR,Greg) and do this for each customer number.
customers
18 = Column P
21 = Column T
25 = Column X
I am using excel 2007
ws is another workbook that has the product list and each customer
below is the code I have that does not work.
Code:
Private Sub I_Line1_DropButt*******()
Dim ws As Worksheet
Dim c As Range
Set ws = Workbooks("Bryant's Pricing by Accounts.xlsm").Sheets("Bryant's Price List")
Me.I_Line1.RowSource = ""
With ws
If Me.I_Cust_No = "18" Then
For Each c In .Range("P8:P100")
If c.Value <> "" Then
With Me.I_Line1
.ColumnCount = 2
.AddItem ws.Range("GDR").Cells(c, 1).Value
.List(.ListCount - 1, 1) = ws.Range("Greg").Cells(c, 1).Value
End With
End If
Next c
Else
Exit Sub
End If
End With
I am using DropButt******* because it made sense to me if there is a better way please put me on the right path.
any help on this would be great
Thanks
Greg