There are title & other rows above the data which precludes using any 'columns()'.
Here's what I have so far, but the filter seems to be putting the filter criteria into multiple quotes i.e. 13/10/21 becomes ""13/10/21"".
Code: Select all
Sub FilterOnOff2()
' Ensures data gets pasted into the correct rows
' by removing any filters then re-applying
Sheets("Combined").Select
Dim FltrDte As Date
Range("A6").Select
Selection.AutoFilter
Range(Selection, Selection.End(xlToRight)).Select
Selection.AutoFilter
Range("A7").Select
FltrDte = Range("D1").Value
ActiveSheet.Range("$A$6:$AF$3401").AutoFilter Field:=2, Operator:= _
xlFilterValues, Criteria2:=Array(2, FltrDte)
End Sub
N.B. FltrDte is a simple MAX calc. Did try .value & .string too.