See if this is fast enough.
For the layout for output range in uploaded workbook.
Sub test()
Dim a, x, i As Long, ii As Long, n As Long, myCol, Emp As String, flg As Boolean
myCol = Array(2, 6, 7, 8): Emp = Sheets("sheet1").ComboBox1.Value
x = Filter([transpose(if(r1:r10000<>"",r1:r10000))], False, 0)
a = Cells(1).CurrentRegion.Value
For i = 2 To UBound(a, 1)
If (a(i, 1) = Emp) * (a(i, 7) > 0) Then
For ii = 0 To UBound(x)
If a(i, 2) = x(ii) Then flg = True: Exit For
Next
If Not flg Then
n = n + 1
For ii = 0 To UBound(myCol)
a(n, ii + 1) = a(i, myCol(ii))
Next
End If
flg = False
End If
Next
Range("k23").CurrentRegion.Offset(2).ClearContents
If n > 0 Then
With Range("k24").Resize(n, UBound(myCol) + 1)
.Value = a
.Sort .Cells(1, 2), 2, , .Cells(1, 3), 2
End With
Else
MsgBox "No match"
End If
End Sub
Bookmarks