Trying to use an Advanced Filter Sub: xlFilterCopy to select a set data according to a begining and ending date in a sheet. I am getting a argument not optional error.
Code:
Sub Sortbydate()
Range("A2:E500").advancedfilter
Action = xlFilterCopy
CriteriRange = Range("J4:K4")
Range("N2").Select
ActiveSheet.Paste
Range("Q29").Select
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = "=SUM(R[-27]C:R[-1]C)"
Range("R29").Select
ActiveCell.FormulaR1C1 = "=SUM(R[-27]C:R[-1]C)"
Range("R30").Select
End Sub
Bookmarks