View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bill Pfister Bill Pfister is offline
external usenet poster
 
Posts: 132
Default Print Page Totals

Here is a psuedocode approach. Your only issue will be determining the
proper range, but this is not a terribly difficult task.

set rngTest = ' here you need to specify the range that you want to sum that
is
' visible on this particular printed page
dblSum = Application.WorksheetFunction.Sum( rngTest )
ActiveSheet.PageSetup.RightFooter = "Page Amount = " & dblSum


Regards,
Bill



"Doug F." wrote:

On each page printed I want to sum a column on that page and print that total
on the bottom of that page, probably in the footer (ie a total amount for a
data entry balancing process performed elsewhere). Each page has its own
total it's not a running total. I've tried variations of the following where
'test' is a named column label:

Public Sub Worksheet_BeforePrint(Cancel As Boolean)
ActiveSheet.PageSetup.RightFooter = "Page Amount = " & Sum([test])
End Sub

It doesn't like the Sum function in this event.

Ideas? Thanks,
--
Doug F.