ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Updating the date in Custom Header (https://www.excelbanter.com/excel-discussion-misc-queries/148213-updating-date-custom-header.html)

mjlevie

Updating the date in Custom Header
 
I would like to be able to create a header where I can either link the date
to another cell in the worksheet or be able to have the date in the header
always refer to the previous month end. Such as May 31, 2007 for this month.

Bob Umlas

Updating the date in Custom Header
 
You need to put code in the Workbook_BeforePrint Event:
ActiveSheet.PageSetup.LeftHeader = Format(Range("A1").Value,"Short Date")
for example.

"mjlevie" wrote in message
...
I would like to be able to create a header where I can either link the date
to another cell in the worksheet or be able to have the date in the header
always refer to the previous month end. Such as May 31, 2007 for this
month.




Peo Sjoblom

Updating the date in Custom Header
 
How about a formula?

=DATE(YEAR(TODAY()),MONTH(TODAY()),0)


--
Regards,

Peo Sjoblom




"Bob Umlas" wrote in message
...
You need to put code in the Workbook_BeforePrint Event:
ActiveSheet.PageSetup.LeftHeader = Format(Range("A1").Value,"Short Date")
for example.

"mjlevie" wrote in message
...
I would like to be able to create a header where I can either link the
date
to another cell in the worksheet or be able to have the date in the
header
always refer to the previous month end. Such as May 31, 2007 for this
month.







All times are GMT +1. The time now is 02:06 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com