I notice my VBA script doesn't work when there's an autofilter already on. Any idea why this is?
wbk.Activate
Set Criteria = Sheets("Sheet1").Cells(i, 1)
Set rng = Sheets("Sheet1").Range(Cells(i, 2), Cells(i, 4))
wb.Activate
If ActiveSheet.AutoFilterMode Then ActiveSheet.ShowAllData 'remove autofilter, but it crashes on this line
Selection.AutoFilter
Range("$A$1:$BM$204").AutoFilter Field:=2, Criteria1:=Criteria.Value
rng.Copy
Range("$BC$2:$BE$204").SpecialCells(xlCellTypeVisible).PasteSpecial
Many thanks