#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,480
Default 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


  #3   Report Post  
Posted to microsoft.public.excel.misc
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

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default 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



  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default 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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Display "this week" column headers w/date & day of week? Ivan Wiegand Excel Worksheet Functions 9 September 12th 07 05:18 PM
Date Function formula that will return the date of a specific week Greg Excel Worksheet Functions 4 June 12th 06 05:07 PM
How do I add the day of the week to Excel header Whoziz Excel Discussion (Misc queries) 1 April 28th 06 09:01 PM
Finding the Monday date based on a different date in same week dandiehl Excel Worksheet Functions 4 April 11th 06 06:03 PM
I need week number in excell from a date, first week must be mini. jPeich Excel Discussion (Misc queries) 4 January 5th 05 01:21 AM


All times are GMT +1. The time now is 08:30 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"