I have been trying to replace a group of macros in a workbook here because they are slow due to the shear volume of data. I posted an earlier attempt which filtered the data twice but because if read the filtered ranges cell by cell into a holding array it was too slow.
I have my two arrays "Var" and "vaData" but cant think of a course to take from here. Any pointers or suggested methods appreciated
Sub FilterArr()
Dim lng1, lng2, Lrow As Long
Dim rng As Range
Dim vaData, Var As Variant
Dim ws As Worksheet
Set rng = Sheet2.Range("P1:P" & Cells(Rows.Count, "P").End(xlUp).Row)
Set ws = Sheet1
With ws
Lrow = .Range("a" & Rows.Count).End(xlUp).Row
Var = .UsedRange.Value
For lng1 = LBound(Var, 1) To UBound(Var, 1)
For lng2 = LBound(Var, 2) To UBound(Var, 2)
Next lng2
Next lng1
''''Array created
vaData = rng.Value
''''Advanced Filter range is "rng"
''''Filter Var using vaData as criteria
'>>>>>>>Write array back to source sheet once cleared
End With
End Sub
Bookmarks