Formulae in headers or footers


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,
 
Ad

Advertisements

G

Guest

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
 
Ad

Advertisements

L

Lee

Thanks, I don't know anything about VBA but I will try the cut and paste
thing.
Thanks again,
Lee
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top