Forum Discussion
Fred_Schieferstein
Jan 06, 2023Copper Contributor
Date in a header
How do you change the date format in a header? Control 1 does not work.
- NikolinoDEGold Contributor
Insert the date or time in a header or footer
If you want the exact date or time a form was printed to be reflected in the printed form, you can use AutoText codes in the Insert Header and Insert Footer dialog boxes to accomplish this task.
You can also design your form template so that dates entered into the form by users will print automatically in the header or footer. For example, in an expense report form template, you might want start and end dates for the expense period to print in the form's footer.
What do you want to do?
Insert the current date in the header or footer
Insert the current time in the header or footer
Insert dates from the form in the header or footer
- Fred_SchiefersteinCopper ContributorI clicked on your link "Insert the current date in the header or footer". The first step states on the view menu, click header and footer. When I click the view menu I don't receive a header and footer tab to click on! What do I do now?
- dscheikeyBronze Contributor
Hello Fred,
is your header a normal cell? Is it the header of a formatted table? CTRL + 1 should actually always work. Have you already tried it via the menu?
- Fred_SchiefersteinCopper Contributor
dscheikey Contro; 1 didn't work
- dscheikeyBronze Contributor
Hello Fred, your answer was not particularly helpful, because you already wrote the hint that CTRL + 1 does not work in your original post.
My answer here refers to the headers in formatting tables. Headers in printings are not discussed here. Unfortunately, you did not give an answer to my question.
The data in the header is converted to static values when the table is created. This means that formatting the number format is no longer possible. If you try to make a header row out of a formula (e.g. =TODAY()), you will get the following error:
Formulas or rich data types can't be used in the header row of a table. Convert them to static values before you create the table.
This is quite logical. A date in Excel is actually a number. From 31/12/1899, a day is added to 1. The 44932 stands for 06/01/2023. There are countless format display options for the date format. What should your table field be called now? =myTable[06/01/2023] or =myTable[44932]?
There is still one piece of good news though. While experimenting, I found that you can change the date format, but it is not directly displayed as a new format. You can help yourself with a workaround.I have written a help line under the table in which I output the values with =VALUE(A1:D1) - i.e. the header lines of my table with the dates. Provided the conversion to values has worked, there are then numbers in the row. Then you can change your number format in the header rows. Then copy the help line and paste it into the header line with Paste Values. Then you have changed the number format of the header.
I hope this was helpful for you.