View Single Post
  #2   Report Post  
Dave Peterson
 
Posts: n/a
Default

The bad news is that if you don't include the rows to repeat at top, then more
stuff can be printed on each page.


For instance, in my test data, I set it up to use rows 1:2 as rows to repeat at
top. I didn't add any manual page breaks.

Page 1 showed 1:2 and 3:52 (52 rows)
Page 2 showed 1:2 and 53:102 (still 52 rows)

I removed those rows to repeat at top and tried to print pages 3-???
But excel figures that without the header, more rows could be printed on page 2
(no need to reserve room for 1:2 header rows).

So I saw page 3 printed 105:156 (still 52 rows)
and page 4 printed 157:208 (still 52 rows).

=========
But if I did the same kind of thing, but had manual page breaks for at least the
first 2 pages, it worked ok. But I made sure that page one and two were smaller
than 52 lines per page.

(And all of this really depends on the rowheight of rows 1 & 2.)

So if you want to play around with your page breaks, you may be able to use:

Option Explicit
Sub testme()
With ActiveSheet
.PageSetup.PrintTitleRows = "$1:$2"
.PrintOut preview:=True, from:=1, to:=2
.PageSetup.PrintTitleRows = ""
.PrintOut preview:=True, from:=3, to:=999
End With
End Sub

(I used preview:=true to save some trees when I was testing.)

======
Another workaround would be to format the header rows so that they don't show
anything. If you've only use a General numberformat, you could something like:

Option Explicit
Sub testme()
With ActiveSheet
.PageSetup.PrintTitleRows = "$1:$2"
.PrintOut preview:=True, from:=1, to:=2
.Rows("1:2").NumberFormat = ";;;"
.PrintOut preview:=True, from:=3, to:=999
.Rows("1:2").NumberFormat = "General"
End With
End Sub

(This does make it look like there's more of a header, though.)

If you have different formats, you can keep track of them and put 'em back the
way they were.



Val wrote:

I have selected the row header to print for pages one and two but I don't
want it to print on subsequent pages. How do I make this happen?


--

Dave Peterson