Calculations in Footers

  • Thread starter Thread starter Hotard
  • Start date Start date
H

Hotard

Is it possible to calculate dates in Excel within the footers?

I know how to get what I want (a week from today's date: =Today()+7) i
the spreadsheet but want to do the same thing in the footer.

My apologies if this is pretty basic and any suggestions would b
greatly appreciated. Thanks
 
Hotard, you'll need VBA. Here's some code that I cribbed from some earlier
postings:

Private Sub Workbook_Open()

Dim wsSheet As Worksheet
For Each wsSheet In Worksheets
wsSheet.PageSetup.LeftFooter = Format(Now() + 7, "mmmm d,
yyyy")
Next wsSheet

End Sub

Open your workbook file, unmaximize the workbook window, right-click the
workbook window title bar and select View Code. Paste the code into the
window that appears, then File > Close and Return to Excel. Save and close
your workbook file, then open it and make sure you have macros enabled.

Note that this will give you the date calculation in the left footer
(on all worksheets, btw). You can change it to center or right if you want.
You can also change the date format.

For more information on this topic, see this page:
http://www.mvps.org/dmcritchie/excel/pathname.htm. Scroll down to the
heading "Including a Date in a Footer."
 
Back
Top