pages break in the 66rd line , 132, etc...
Something like this pseudo code. You might have to play with it a little to
get the pagebreaks exactly where you want them.
Lastrow = cells(rows.count,1).End(xlup).row
i = 66
do
j = i + 1
do
j = j -1
if Application.CountA(rows(j)) = 0 then _
Activesheet.HPageBreaks.Add Befo=rows(j + 1)
Loop while Application.CountA(rows(j)) < 0
i = j + 66
Loop while i < LastRow
--
Regards,
Tom Ogilvy
"...Patrick" wrote:
Hello,
(sorry for my poor english) :-))
I copy a lot of tables in one to resume (it works) ; all areas have the same
structure (from column A to K) but not the same numbers of rows; the grand
total varies from 200 to 500 lines; i would like, after the copy, to place
page break all the 66 lines (with a font 10, A4 paper) but if the ligne
66-132 etc.. is not free, the page break must be placed in a free
line..before like 65-64-63.
Thank you
Patrick
|