![]() |
|
|
|
#1
|
|||
|
|||
|
Hi, all,
I want to have just the current year in a header in Excel. I'm too lazy to update it every year. So how can I insert just the year in a header (or footer)?I've tried formulas used in cells: =YEAR(TODAY()) &YEAR(TODAY()) and they don't work. Does anyone know the magic formula? I want it to appear as: Text text text 2019 |
|
#2
|
|||
|
|||
|
Just run this macro once a year. No need to store a date on the worksheet.
Code:
Sub add_date_header()
ActiveSheet.PageSetup.CenterHeader = Format(Date, "yyyy")
End Sub
|
|
#3
|
|||
|
|||
|
I think it would be easier to type four numbers than to learn how to run a macro and then remember to run it once a year. :/ But I hope this macro helps someone else. Thank you for your time and effort!
|
|
| Tags |
| footer, header, year |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Adding text to the header and footer without removing all other content in the header and footer | digitalelise | Word VBA | 2 | 10-23-2019 02:58 AM |
VBA to move selected emails or conversation to current year pst folder
|
webharvest | Outlook | 1 | 08-15-2015 01:55 AM |
| How to save the current page in a new file with all the page settings (header, footer | Jamal NUMAN | Word | 6 | 03-15-2012 03:27 PM |
How to call current PC date and/or current PC year
|
KIM SOLIS | Excel | 2 | 11-04-2011 06:09 PM |
Auto insert current month's name and current year
|
Styler001 | Word | 4 | 01-25-2010 06:40 PM |