Print Excel Headers on First Page Only

B

Brian Bonewitz

Hey folks,

I can't seem to figure out how to get headers and or footers print on ONLY
the first page. I have set page break between the two pages and tried to
delete it on the second page and it deletes the header on both the first and
second page.

Can someone give me some help on how to get the header to print on the first
page only?

Thanks,
Brian
 
J

Julian Milano

I know.....why is it in Word but not XL!??

You're gonna have to code this one. Here's a starter:

Sub PrintDiffHeader()
'
' PrintDiffHeader Macro
' Macro recorded 29/01/2004 by Julian
'

'
With ActiveSheet.PageSetup
.LeftHeader = "section 1 Header"
.PaperSize = xlPaperA4
.FirstPageNumber = xlAutomatic
End With
ActiveWindow.SelectedSheets.PrintOut From:=1, To:=1, Copies:=1, Collate
_
:=True
With ActiveSheet.PageSetup
.LeftHeader = "section 2 Header"
.PaperSize = xlPaperA4
.FirstPageNumber = xlAutomatic
End With
ActiveWindow.SelectedSheets.PrintOut From:=2, To:=2, Copies:=1, Collate
_
:=True
End Sub

Basically, set the header, print the first page, set the header to a new
value, print the second page, etc......
 
B

Brian Bonewitz

You've got to be kidding? What was Microsoft thinking... DUH!!! What an
obvious feature...
Enough ranting though, thank you for sharing the code to resolve this
problem. It's greatly appreciated!!

-Brian
 
J

Julian Milano

LoL.

--

Julian Milano


Brian Bonewitz said:
You've got to be kidding? What was Microsoft thinking... DUH!!! What an
obvious feature...
Enough ranting though, thank you for sharing the code to resolve this
problem. It's greatly appreciated!!

-Brian
 

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