Thread
:
Advanced filter on last months results
View Single Post
#
4
Posted to microsoft.public.excel.programming
Claus Busch
external usenet poster
Posts: 3,872
Advanced filter on last months results
Hi Eddie,
Am Sat, 28 Dec 2013 04:58:22 -0800 (PST) schrieb
:
Thanks for you suggestion I am using Excel 2003 and It look like xlFilterLastMonth will not work with this version?
then try:
Sub Test()
Dim StartD As Double
Dim EndD As Double
StartD = DateSerial(Year(Date), Month(Date) - 1, 1)
EndD = DateSerial(Year(Date), Month(Date), 0)
ActiveSheet.Range("D:D").AutoFilter Field:=1, Criteria1:= _
"=" & StartD, Operator:=xlAnd, Criteria2:="<=" & EndD
End Sub
Regards
Claus B.
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2
Reply With Quote
Claus Busch
View Public Profile
Find all posts by Claus Busch