View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
What-A-Tool What-A-Tool is offline
external usenet poster
 
Posts: 14
Default Macro geneated headers not displaying some sheets


"Jim Cone" wrote in message
...

You are printing three lines in the center header.
Are the header margins large enough to accommodate that?
Also, the first two lines in the center header are almost identical.
It appears you could eliminate the first line.
For what its worth, here is a little more efficient version of the code...

Public Sub HeaderSet()
Dim sht As Worksheet
Dim s_Author As String

s_Author = "Fill in the Name" '<<<<
For Each sht In Workbooks(s_Author & ".xls").Worksheets
' MsgBox sht.Name
sht.PageSetup.LeftHeader = "Page No. " & "&P" & " of &N"
sht.PageSetup.CenterHeader = "&F" & Chr(10) & "&A"
sht.PageSetup.RightHeader = "&D"
Next sht
End Sub

Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware


"What-A-Tool"
wrote in message

The strange thing is, when I PRINT PREVIEW, and click SETUP, then click
the
HEADER/FOOTER tab, the correct header is displayed, even for the sheets
that
don't display it in PRINT PREVIEW. (It doesn't print on hard copies,
either)


Thanks Jim.

Not much diffferent than what I have. Still doesn't make a difference,
though. I tried putting in just the strings "a", "b", and "c" for the 3
different alignments and get the same result(or lack thereof).