hi guys; happy new year. i am running an excel2000 spreadsheet and i am trying to filter data entries for april. my vba code - recorded via macro creation - is as follows. when i run it, it does the job but also includes the first data entry whose date is not april ref E31. Name "SortArea" starts from $A$31 to $K$5000. may someone tell me where i have gone wrong? ta
Sub Entry04Apr()
'
' Entry03Mar Macro
' Macro recorded 29/12/2001 by csn2k
'
'
Application.Goto Reference:="SortArea"
Selection.Sort Key1:=Range("E31"
, Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Selection.AutoFilter
Selection.AutoFilter Field:=5, Criteria1:=">=01-Apr", Operator:=xlAnd _
, Criteria2:="<=30-Apr"
ActiveWindow.SelectedSheets.PrintPreview
End Sub
Sub Entry04Apr()
'
' Entry03Mar Macro
' Macro recorded 29/12/2001 by csn2k
'
'
Application.Goto Reference:="SortArea"
Selection.Sort Key1:=Range("E31"
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Selection.AutoFilter
Selection.AutoFilter Field:=5, Criteria1:=">=01-Apr", Operator:=xlAnd _
, Criteria2:="<=30-Apr"
ActiveWindow.SelectedSheets.PrintPreview
End Sub