View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
Stefi Stefi is offline
external usenet poster
 
Posts: 2,646
Default Subtotal in header

Well, thanks to all of you, finally I wrote a macro printing separately the
sections with the same value in the column by which subtotals are created and
counting the number of pages belonging to these values (on the base of
HPagebreaks(n)).

Nevertheless it would be beneficious to include a new feature in a later
version of XL (something like an event AfterPageBreak)!

Regards,
Stefi


€˛Jeff Standen€¯ ezt Ć*rta:

I think you would have to calc the subtotal for page 1, put it in the
header, print, then calc page 2, put it in the header and print etc. I don't
think you can interrupt the print spool in the way you are thinking. This
could be a problem if you are printing to a file or if others could be
printing pages in between yours but otherwise it should be okay.

Jeff

"Stefi" wrote in message
...
Thanks for your reply! My problem is that can I call a Sub at each page
break
which makes this setup for me or should I write a macro that prints each
pages separately (running a custom page setup before all printouts)?

Regards,
Stefi


"Gary''s Student" ezt Ć*rta:

Something like:

Sub Macro1()
ActiveSheet.PageSetup.CenterHeader = Range("C3").Value
End Sub

will put the value of any cell (here C3) in the header.

If you are producing a page-by-page report with a different header for
each
page, then you would use a macvro that performs setup-and-print for each
page.
--
Gary's Student


"Stefi" wrote:

Hi All,

I have a sheet subtotalled by column E with page breaks. I'd like to
display
the value of column E on a particular page in the header of that page.
How
can I do that?
E.g.
Page1 (requested value in header: AC06)
A B C D
E F
2006.05.22 5 98 24/2006 AC06 2 000
2006.05.22 5 98 26/2006 AC06 2 000
AC06 Subtotal 4 000
Page2 (requested value in header: BB08)
2006.05.18 5 96 0054187 BB08 44 800
2006.05.18 5 96 0054188 BB08 40 250
2006.05.19 5 97 0054195 BB08 42 840
BB08 Subtotal 127 890

Thanks,
Stefi