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

Hi Bob,

Sorry, perhaps my explanation was not clear: AC06 is not a cell reference,
it's simply a code that by chance resembles XL cell references. On the other
hand your macro places the same value in the header of all pages. I need a
different value on each pages according to the value of column E on that page.
Any other idea? See also my post to Gary"s Student!

Regards,
Stefi


€˛Bob Phillips€¯ ezt Ć*rta:

Private Sub Workbook_BeforePrint(Cancel As Boolean)
With ActiveSheet
If .Name = "Sheet1" Then
.PageSetup.LeftHeader = .Range("AC06").Value
End If
End With
End Sub

'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code


---
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Stefi" wrote in message
...
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