Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

filtering in excel 2000

Status
Not open for further replies.

sncheong

Programmer
Jan 18, 2001
47
NZ
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:=&quot;<=30-Apr&quot;
ActiveWindow.SelectedSheets.PrintPreview
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top