how can i extend the printable area up to the very last row

K

kaveh

how can i extend the printable area up to the very last row (i can't go
beyond 265 pages) in Page Break Preview?
 
B

Barb Reinhardt

I believe there is a limit to the number of manual page breaks you can have.
(at least in 2003)
 
G

Gord Dibben

Barb

OP did not have the proper print range set. Once done, was able to get all
the pages needed.

I am able to get pagebreaks for A1:A65536 range in Excel 2003.

I can find no limit other than 65536 rows.


Gord
 
D

Dave Peterson

This blew up for me on the 1028th pagebreak:

Option Explicit
Sub testme()
Dim iCtr As Long

With ActiveSheet
On Error Resume Next
For iCtr = 2 To .Rows.Count
.HPageBreaks.Add before:=.Cells(iCtr, "A")
If Err.Number = 0 Then
'ok
Else
Err.Clear
MsgBox "Error with: " & iCtr & vbLf & iCtr - 1 & " worked ok"
Exit For
End If
Next iCtr
On Error GoTo 0
End With
End Sub




ps. I used xl2003.
 
G

Gord Dibben

Blew up on me also.

My earlier test was manual by entering data in column A to row 65536.

Set margins to give me two rows per page.

Pagebreak preview shows 32768 pages.

This returns 32768 pages.

Sub test_pages()
totalpages = Application.ExecuteExcel4Macro("GET.DOCUMENT(50)")
MsgBox totalpages
End Sub

I'm not about to print out to test<g>


Gord
 
G

Gord Dibben

Although.......help on specs states 1000 horizontal and vertical pagebreak
limit

So..........what preview shows ain't necessarily what you will get.

Off to bed now<g>


Gord
 
K

kaveh

Thank you so much.

Dave Peterson said:
This blew up for me on the 1028th pagebreak:

Option Explicit
Sub testme()
Dim iCtr As Long

With ActiveSheet
On Error Resume Next
For iCtr = 2 To .Rows.Count
.HPageBreaks.Add before:=.Cells(iCtr, "A")
If Err.Number = 0 Then
'ok
Else
Err.Clear
MsgBox "Error with: " & iCtr & vbLf & iCtr - 1 & " worked ok"
Exit For
End If
Next iCtr
On Error GoTo 0
End With
End Sub




ps. I used xl2003.
 
K

kaveh

Thanks for your answear.

Gord Dibben said:
Barb

OP did not have the proper print range set. Once done, was able to get all
the pages needed.

I am able to get pagebreaks for A1:A65536 range in Excel 2003.

I can find no limit other than 65536 rows.


Gord
 

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