thank you Blue, i eventually did this:
Private Sub BxStaDistrict_AfterUpdate()
Dim Cl As Range
Dim ClAddress As String
Dim coll As New Collection
Dim itm As Variant
'if no selection in district quit
If Me.BxStaDistrict.ListIndex < 0 Then Exit Sub
With Sheet17
Set rSource = .Range(.Cells(1, 1), .Cells(.Rows.Count, 1).End(xlUp))
End With
With Me
.BxStaName.Clear
.BxStaOIC.Clear
Set Cl = rSource.Find(What:=Me.BxStaDistrict.Value, LookIn:=xlValues, LookAt:=xlWhole)
If Not Cl Is Nothing Then
ClAddress = Cl.Address
Do
On Error Resume Next
coll.Add Item:=Cl.Offset(0, 1).Value, Key:=CStr(Cl.Offset(0, 1).Value)
On Error GoTo 0
Set Cl = rSource.FindNext(After:=Cl)
Loop While Not Cl Is Nothing And Cl.Address <> ClAddress
End If
For Each itm In coll
.BxStaName.AddItem itm
Next itm
End With
End Sub
Private Sub BxStaName_AfterUpdate()
Dim Cl As Range
Dim ClAddress As String
Dim coll As New Collection
Dim itm As Variant
'if no selection in name quit
If .BxStaName.ListIndex < 0 Then Exit Sub
With Sheet17
Set rSource = .Range(.Cells(1, 2), .Cells(.Rows.Count, 2).End(xlUp))
End With
With Me
.BxStaOIC.Clear
Set Cl = rSource.Find(What:=Me.BxStaName.Value, LookIn:=xlValues, LookAt:=xlWhole)
If Not Cl Is Nothing Then
ClAddress = Cl.Address
Do
On Error Resume Next
coll.Add Item:=Cl.Offset(0, 1).Value, Key:=CStr(Cl.Offset(0, 1).Value)
On Error GoTo 0
Set Cl = rSource.FindNext(After:=Cl)
Loop While Not Cl Is Nothing And Cl.Address <> ClAddress
End If
For Each itm In coll
.BxStaOIC.AddItem itm
Next itm
End With
End Sub
Bookmarks