Filter Date

M

mulehead

How do you filter dates to show the last date or the last three dates in a
spreadsheet relative to the current dates on a spreadsheet, meaning without
actually entering a specific date?
 
F

Farhad

Hi,

You can do it by auto filter and the filter by choosing costom and:

for today put equal to 09/21/2007 and
for last 3 days put grater than 09/19/2007

Thanks,
 
M

mulehead

I am trying to build a macro with the filter so I will have to use a fomula
without putting in a specific date, I am sorry I was not more clear on this,
Thank you Farhad for replying. Does anybody have any ideas?
 
F

Fred Smith

Ok. What's the formula?

If, for example, you want the last three days (ie, today, yesterday and the day
before yesterday), use something like:

Startdate = date - 3
selection.autofilter field:=1, criteria1:="<" & startdate
 
Top