Hi, I've used VBAcode form other message boards to try and get this to work however it's only adding the filter to column A when I need the filter on for the entire top row ( I also want to filter column E if it contains "Receive") . In column A is a list of dates but I only want to see the Latest Date (won't always be yesterday, could be 4 or 5 days ago) Can someone help me amend this? Thanks
Sub PSRpt()
Dim myDate As Date
myDate = Application.Max(Columns(1))
ActiveSheet.AutoFilterMode = False
Columns(1).AutoFilter Field:=1, Criteria1:="=" & Format(myDate, [A2].NumberFormat)
Worksheets("PS Report").Range("B:B,C:C,F:H,K:Q,T:U,AF:AG,AK:AN,AP:AQ").EntireColumn.Hidden = True
Selection.Copy
Range("AR1").Select
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = "Comments"
Range("AQ1").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
ActiveCell.Offset(0, 1).Select
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
End Sub
Sub PSRpt()
Dim myDate As Date
myDate = Application.Max(Columns(1))
ActiveSheet.AutoFilterMode = False
Columns(1).AutoFilter Field:=1, Criteria1:="=" & Format(myDate, [A2].NumberFormat)
Worksheets("PS Report").Range("B:B,C:C,F:H,K:Q,T:U,AF:AG,AK:AN,AP:AQ").EntireColumn.Hidden = True
Selection.Copy
Range("AR1").Select
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = "Comments"
Range("AQ1").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
ActiveCell.Offset(0, 1).Select
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
End Sub