Hello
Its pretty much in the header, I need to select multiple criteria in an autofilter, I have found the best way to do this is in an array. I can add the array but i'm struggling to add the conditions to the array within the criteria.
here is my example:
Dim Counter As Integer
Dim wksht As String
Dim Condition(4) As Variant
Workbooks("KYC Downloader.xlsm").Activate
Sheets("Front Sheet").Select
Sheets("Front Sheet").Copy Before:=Workbooks("Raw Data.Xlsx").Sheets(1)
Range("A2").Select
Sheets("Sheet1").Activate
Cells.EntireColumn.AutoFit
Selection.AutoFilter
For Counter = 1 To 9
Worksheets.Add.Name = Counter
Sheets("Front Sheet").Select
column = ActiveCell.Offset(0, 3)
Condition(0) = ActiveCell.Offset(0, 4)
Condition(1) = ActiveCell.Offset(0, 5)
Condition(2) = ActiveCell.Offset(0, 6)
Condition(3) = ActiveCell.Offset(0, 7)
wksht = Counter
Sheets("Sheet1").Select
Selection.AutoFilter Field:=column, Criteria1:=Condition() ' i cant get it to add all the elements into the array
Cells.Select
Selection.Copy
Sheets(wksht).Activate
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats
Cells.EntireColumn.AutoFit
Sheets("Front Sheet").Activate
ActiveCell.Offset(1, 0).Select
Sheets("Sheet1").Select
Selection.AutoFilter
Next Counter
Please can someone help me?
Thanks
Ricco
Bookmarks