View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default Date: Week in header

Put the following macro in the workbook code area:

Private Sub Workbook_BeforePrint(Cancel As Boolean)
d = Date
d1 = d - Application.WorksheetFunction.Weekday(d) + 2
d2 = d1 + 4
ActiveSheet.PageSetup.CenterHeader = d1 & "-" & d2
End Sub
--
Gary''s Student - gsnu200759


"happysak" wrote:

I need to automatically add to a header the dates of the week (Monday through
Friday) that the current date falls in. For example, today is 12/04/2007. I
want the header to also show that this week is 12/03/07-12/07/07. Any help?
Thanks
--
happysak