ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   is there a way to format the date in an excel footer eg just year (https://www.excelbanter.com/excel-worksheet-functions/152400-there-way-format-date-excel-footer-eg-just-year.html)

Mark

is there a way to format the date in an excel footer eg just year
 
trying to automate a copywrite notice that contains just the year, is there a
way to limit/format how &[Date] shows in the footer?

Dave Peterson

is there a way to format the date in an excel footer eg just year
 
Record a macro when you add any old copyright date to a footer.

You'll get some code that boils down to something like:

With ActiveSheet.PageSetup
.CenterFooter = "Copyright: 12/25/2007"
End With

You can change it to:

With worksheets("sheet9999").PageSetup
.CenterFooter = "Copyright: " & format(date, "yyyy")
End With

Date is today's date -- like =today() in a cell.


Mark wrote:

trying to automate a copywrite notice that contains just the year, is there a
way to limit/format how &[Date] shows in the footer?


--

Dave Peterson


All times are GMT +1. The time now is 12:55 PM.

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