Date: Week in header
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 |
Date: Week in header
Hi
Try =TEXT((A1-WEEKDAY(A1)+2),"dd/mm/yy")& " - " &TEXT((A1-WEEKDAY(A1))+6,"dd/mm/yy") -- Regards Roger Govier "happysak" wrote in message ... 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 |
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 |
Date: Week in header
This might have worked with a little tweaking. You gave me lots of ideas I
can use another time. In the meantime, next reply worked. Thanks for your help. -- happysak "Roger Govier" wrote: Hi Try =TEXT((A1-WEEKDAY(A1)+2),"dd/mm/yy")& " - " &TEXT((A1-WEEKDAY(A1))+6,"dd/mm/yy") -- Regards Roger Govier "happysak" wrote in message ... 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 |
Date: Week in header
This worked just fine. I actually wanted the week on the left under some
other dates, text, etc., but I was able to figure out how to do that. This will make my life a whole lot easier. Thank you for your expertise and for sharing it. -- happysak "Gary''s Student" wrote: 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 |
All times are GMT +1. The time now is 11:14 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com