Option Explicit
Sub TEST1()
Dim ar, br, i&, j&, r&, strFind$, isFlag As Boolean
strFind = [C2].Value
If Len(strFind) = 0 Then Exit Sub
ar = Sheets(1).[A1].CurrentRegion.Value
ReDim br(1 To UBound(ar), 1 To UBound(ar, 2))
For i = 5 To UBound(ar)
isFlag = True
For j = 1 To Len(strFind)
If InStr(ar(i, 2), Mid(strFind, j, 1)) = 0 Then
isFlag = False
Exit For
End If
Next j
If isFlag Then
r = r + 1
br(r, 1) = r
For j = 2 To UBound(br, 2)
br(r, j) = ar(i, j)
Next j
End If
Next i
[A1].CurrentRegion.Offset(3, 1).ClearContents
If r Then [A4].Resize(r, UBound(br, 2)) = br
Beep
End Sub
|