View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 6,953
Default Filter for Day of the Week

If you doing an autofilter, then you can put in a custom criteria that the
data less than or eqaul to 1 date (next Saturday) and greater than or equal
to another date(today's date).

if you are in the US or Canada, this should be no problem. turn on the
macro recorder and apply the dates manually to the filter. Now turn the
macro recorder off and look at the recorded code. You can replace the hard
coded dates recorded with your calculated dates (using the Weekday function)

--
Regards,
Tom Ogilvy


"jmdaniel" wrote:

I want to filter some data by, among other things, whether the date in one of
the columns is between the date the macro runs and Saturday of that week. The
macro will not always be run on the same day of the week. I searched high and
low on this board, but found nothing like that. I think what may work is
using a dialog box, where the person running the macro would be asked how
many days until Saturday. I would insert a column into the data that
calculated the number of days between the current date and Saturday, and any
rows where the number generated by the dialog box was less than or equal to
the number showing in my calculated column would be filtered out.

Does that sound like a reasonable solution? Any better ones? I don't know a
thing about dialog boxes, but if it will work, I guess I'll do some self
educating....