Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Formula in a header
Can you put a formula in a header? I would like to get the prior months end
day (7/31/07). in a header? Can this be done? How? Thanks, Donna |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Formula in a header
One way:
Put this in your workbook's ThisWorkbook Code module (if you're not familiar with macros, see http://www.mvps.org/dmcritchie/excel/getstarted.htm ) Private Sub Workbook_BeforePrint(Cancel As Boolean) Dim ws As Worksheet Dim d As Date d = Date For Each ws In ActiveWindow.SelectedSheets ws.PageSetup.LeftHeader = Format(DateSerial(Year(d), _ Month(d), 0), "dd mmm yyyy") Next ws End Sub Substitute CenterHeader or RightHeader, and your favorite date format to suit. In article , Donna S wrote: Can you put a formula in a header? I would like to get the prior months end day (7/31/07). in a header? Can this be done? How? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Adding a formula to the header | Excel Discussion (Misc queries) | |||
If formula in header | Excel Discussion (Misc queries) | |||
Custom Header with Formula | Excel Discussion (Misc queries) | |||
Can you put a formula in a header? | Excel Discussion (Misc queries) | |||
Select header if formula | Excel Worksheet Functions |