Advertisement
Guest User

Untitled

a guest
Jul 18th, 2019
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. Set ws = ThisWorkbook.Worksheets("T&E Report")
  2.  
  3.  
  4.  
  5. MyLastRow1 = Range("C100000").End(xlUp).Row
  6.  
  7.  
  8.  
  9. findarray = Array("J")
  10.  
  11.  
  12.  
  13. ReDim filterarray(0 To 0)
  14.  
  15. j = 0
  16.  
  17.  
  18.  
  19. For k = 0 To UBound(findarray)
  20.  
  21.  
  22.  
  23. For i = 2 To MyLastRow1
  24.  
  25. If InStr(ws.Cells(i, 3).Value, findarray(k)) > 0 Then
  26.  
  27. filterarray(j) = ws.Cells(i, 3).Value
  28.  
  29. j = j + 1
  30.  
  31.  
  32.  
  33. ReDim Preserve filterarray(0 To j)
  34.  
  35. End If
  36.  
  37. Next i
  38.  
  39. Next k
  40.  
  41. ws.Range("$C$1:$C$" & MyLastRow1).AutoFilter Field:=3, Criteria1:=Array(filterarray), Operator:=xlFilterValues
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement