View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.misc
Ross Ross is offline
external usenet poster
 
Posts: 152
Default Printing header rows..

Hi Gord
Thanks for the response. I need the first two pages to have the same header
rows, and the third to have its own. I was hoping 2003 could do that without
having to write code, but apparently not. Seemed like it should be a simple
thing especially since Word's been able to do that for years!?! Maybe they
would do that if enough people suggest it.
Anyway, thanks again...
--
smither fan


"Gord Dibben" wrote:

You mean "rows to repeat at top" to print on two pages only but not the
third or successive pages?

This macro will give you two print jobs with continuous page numbering in a
header or footer.

Revised some code found at Ron de Bruin's Print Tips site.

http://www.rondebruin.nl/print.htm

Sub Test()
Dim TotPages As Long
TotPages = Application.ExecuteExcel4Macro("GET.DOCUMENT(50)")
With ActiveSheet.PageSetup
.PrintTitleRows = "$1:$2" 'adjust range to suit
ActiveSheet.PrintOut From:=1, To:=2
.PrintTitleRows = ""
ActiveSheet.PrintOut From:=3, To:=TotPages
End With
End Sub


Gord Dibben MS Excel MVP

On Sat, 20 Dec 2008 14:56:00 -0800, Ross
wrote:

Hi all
Here's hoping you're all having good holidays!

My situation:
I have a worksheet 3 pages long. I need the first 2 pages to print the same
header rows, but the 3rd sheet not to show those headers, as it has it's own.
Is there any solution other than printing the 3rd page separately?? If I do
that, I believe the page numbering will be messed up??

Thanks