One of these codes work for you, but you need to change the OR and AND. I am not sure which is right for you.
My preference is the last(3rd) code with swapping the OR and AND if necessary
Sub test1()
Dim e As Range
With CreateObject("scripting.dictionary")
.comparemode = 1
For Each e In ActiveSheet.Range("B17:B4516")
If e = "" Or e.Offset(, 8) Then
Else
If Not .exists(e) Then .Add e, Nothing
End If
Next
If .Count Then Me.Lista2.List = Application.Transpose(.keys)
End With
End Sub
Sub test11()
Dim v, i&
With ActiveSheet.Range("B17:J4516")
v = .Value
End With
With CreateObject("scripting.dictionary")
.comparemode = 1
For i = 1 To UBound(v)
If v(i, 9) > 5 Or v(i, 1) = "" Then
Else
If Not .exists(v(i, 1)) Then .Add i, Nothing
End If
Next
If .Count Then Me.Lista2.List = Application.Transpose(.keys)
End With
End Sub
Sub test111()
Dim v, i&
With ActiveSheet.Range("B17:J4516")
v = .Value
End With
With CreateObject("scripting.dictionary")
.comparemode = 1
For i = 1 To UBound(v)
If Len(v(i, 1)) Or v(i, 9) < 5 Then
If Not .exists(v(i, 1)) Then .Item(v(i, 1)) = Empty
End If
Next
If .Count Then Me.Lista2.List = Application.Transpose(.keys)
End With
End Sub
Bookmarks