Ok I've made some headway. I managed to get the listbox to select distinct values but it is now doing it for every cell in the range instead of grouping. at Kit and Lot for each record. (if that makes sense... the code is below) I want it to select the distinct value on A2...E2 and loop but instead it is going down each column and returning the distinct values in each column as a list item.
Private Sub UserForm_Initialize()
Dim PickList As Collection
Dim PickRange As Range
Dim ws As Worksheet
Dim MyVAL As Variant
Set ws = Sheets("Sheet4")
Set PickRange = ws.Range("a2", ws.Range("e2").End(xlDown))
Set myList = New Collection
On Error Resume Next
For Each mycell In PickRange.Cells
myList.ADD mycell.Value, CStr(mycell.Value)
Next mycell
On Error GoTo 0
For Each MyVAL In myList
Me.ListBox1.AddItem MyVAL
Next MyVAL
End Sub
Bookmarks