Date in Excel Header

W

Wink20TCU

Is there a way to modify the date in an Excel Header? I would like to use an
IF function to subtract one or three days depending upon the current date.
 
G

Gord Dibben

You would have to use VBA code to place a cell value into the header.

Here is a basic one.

Sub CellInFooter()
'or Private Sub Workbook_BeforePrint(Cancel As Boolean)
With ActiveSheet
.PageSetup.CenterFooter = .Range("A1").Value
End With
End Sub

Your date would be taken from the cell in which you have the formula that
subtracts the 1 or 3 days.


Gord Dibben MS Excel MVP
 
Top