Formulae in headers or footers

  • Thread starter Thread starter Lee
  • Start date Start date
L

Lee

Is it possible to put totals in a header or footer? I haven't seen any place
that says you can or can't. If you can, then how?
Thanks,
 
You need VBA code to do that. If your data is in D1:D100, this will do as an
example:
Right-click the Excel LOGO near the file menu, select View Code, paste this
in:
Private Sub Workbook_BeforePrint(Cancel As Boolean)
ActiveSheet.PageSetup.RightFooter = "Total = " &
Application.Sum(Range("D1:D100"))
End Sub

Bob Umlas
Excel MVP
 
Thanks, I don't know anything about VBA but I will try the cut and paste
thing.
Thanks again,
Lee
 
Back
Top