ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Header/Footer Formula? (https://www.excelbanter.com/excel-discussion-misc-queries/224446-header-footer-formula.html)

Lo456

Header/Footer Formula?
 
Is it possible to have a formula in a header/footer or is it just for text?
Thanks!

Gord Dibben

Header/Footer Formula?
 
Text only but via VBA you can write the results of a formula to the
Header/Footer

Sub CellInFooter()
With ActiveSheet
.PageSetup.CenterFooter = .Range("A1").Value
End With
End Sub

Where A1 contains a formula.


Gord Dibben MS Excel MVP

On Mon, 16 Mar 2009 12:39:03 -0700, Lo456
wrote:

Is it possible to have a formula in a header/footer or is it just for text?
Thanks!



Shane Devenshire

Header/Footer Formula?
 
Hi,

Just text. However, you can use a Workbook_BeforePrint() procedure to do a
calculation and put it in the Header or Footer:

Private Sub Workbook_BeforePrint(Cancel As Boolean)
'your calculation code here
End Sub

--
If this helps, please click the Yes button.

Cheers,
Shane Devenshire


"Lo456" wrote:

Is it possible to have a formula in a header/footer or is it just for text?
Thanks!


Lo456

Header/Footer Formula?
 
Thanks!!!

"Gord Dibben" wrote:

Text only but via VBA you can write the results of a formula to the
Header/Footer

Sub CellInFooter()
With ActiveSheet
.PageSetup.CenterFooter = .Range("A1").Value
End With
End Sub

Where A1 contains a formula.


Gord Dibben MS Excel MVP

On Mon, 16 Mar 2009 12:39:03 -0700, Lo456
wrote:

Is it possible to have a formula in a header/footer or is it just for text?
Thanks!





All times are GMT +1. The time now is 05:07 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com