View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
lars kofod lars kofod is offline
external usenet poster
 
Posts: 17
Default Hpagebreak help needed please

Thanks Bill
I seemed to work just fine.
I've done as you described. Every time I set a pagebreak
i use Check=1. Just before the Next I test
If check=1 Then
Goto StartCheck
End If
But first it reportes 5 pagebreaks, it does so twice,
then there's suddenly only 3 pagebreaks??
Why is that??

Lars Kofod
-----Original Message-----
Lars Kofod wrote:
Sorry, but I just don't understand what happens when I
use HPageBreak(s).


Slippery things, page breaks.
When you set or remove one the subsequent automatic ones

change.
That might be why you are having problems with

For Each pb In ActiveSheet.HPageBreaks


When the For statement is executed the HPageBreaks

collection is
obtained. Once you have changed a page break the later

members of the
collection are no longer valid.

One approach would be to restart the loop after setting

a page break.



Bill Manville
MVP - Microsoft Excel, Oxford, England
No email replies please - reply in newsgroup

.