At the top of my spreadsheet, I have a line where it says Month: and then the formula =TEXT(TODAY(),"mmmm") which automatically inserts the current month. Is there a way that I can insert that formula into my header? I have tried various options but it simply types the formula.
Kevin Robertson
@Reply 2 days ago
Excel headers and footers don't evaluate worksheet formulas. If you type =TEXT(TODAY(),"mmmm") into a header, Excel treats it as plain text and prints exactly what you typed.
You have a few options:
- Use the built-in header codes such as &D for the current date, but these won't give you just the month name.
- Link the header to a cell using VBA. For example, if cell A1 contains =TEXT(TODAY(),"mmmm"), a macro can set the header to the value of A1:
If you don't want to use VBA, place the month in a cell at the top of the worksheet and include that row in the print area so it appears on every printed page.
Unfortunately, there is no built-in way to use worksheet formulas directly in an Excel header or footer.
Colin SmythOP
@Reply 2 days ago
Thank you for your advice. worked out how to resolve my problem in a different way but appreciate your suggestion for future reference.
Sorry, only students may add comments.
Click here for more
information on how you can set up an account.
If you are a Visitor, go ahead and post your reply as a
new comment, and we'll move it here for you
once it's approved. Be sure to use the same name and email address.