used this
Private Sub UserForm_Initialize()
Dim ND As New Collection
'sort into order
'by customer
'then contact
Sheets("Customer Contacts").Activate
Cells.Select
Selection.Sort Key1:=Range("A2"), Order1:=xlAscending, Key2:=Range("D2") _
, Order2:=xlAscending, Header:=xlGuess, OrderCustom:=1, MatchCase:= _
False, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal, DataOption2 _
:=xlSortNormal
Sheets("customer Contacts").Cells(1, 1).Select
Sheets("purchase orders").Activate
'populate
On Error Resume Next
For i = 2 To Sheets("customer Contacts").UsedRange.Rows.Count
ND.Add Sheets("customer Contacts").Cells(i, 1).Value, CStr(Sheets("customer Contacts").Cells(i, 1).Value)
' Note: the 2nd argument (key) for the Add method must be a string
Next i
x = 1
For Each Item In ND
ComboBox1.AddItem ND.Item(x)
x = x + 1
Next Item
End Sub
any ideas on how to do the second part??
i need to say select bmw
and for a second combo box to have the different contacts in it
i think this is going to be the hard bit
Bookmarks