View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Dave
 
Posts: n/a
Default Excel Macro save as date of last friday

This should get you going. I suggest formating the filename with yyyymmdd so
it can be sorted by filename and still be in correct chronological order.
The below lets you run the macro anytime the following week - doesn't have
to be Wednesday.

Dim MyDay as integer

Dim LastFriday, LastMonday

Dim MyFileName as String

MyDay = Weekday(Date)

LastFriday = Date - (MyDay + 1)

LastMonday = Date - (MyDay + 5)

MyFileName = WorksheetFunction.Text(LastFriday, "yyyymmdd") & ".xls"

db

wrote in message
oups.com...
I need held doing three things within this macro.
3) I need to run a custom filter based on last weeks dates. ie greater
than or equal to 5-7-06 and less than or equal to 5-13-06.
1) I need the header to contain last Friday's date. ie Work report
05/12/06.
2) I need to save the file with last Friday's date. ie work report
05-12-06.xls


I only run this macro on wednesdays so I hope that based on the current
date being a wednesday there is a calculation that will let me figure
out all those dates.

Thanks!
-K