Thread
:
Auto Page Break
View Single Post
#
5
Posted to microsoft.public.excel.worksheet.functions
Ardus Petus
Posts: n/a
Auto Page Break
Try:
For lRow = 1 + lPageLength To .UsedRange.Rows.Count Step lPageLength
(add a dot before UsedRange).
If it does not work, please post back
--
AP
"JAB" a écrit dans le message de news:
...
When I go to run it, it says, "run-time error '424'", "object required" ,
then it points me to "For lRow = 1 + lPageLength To UsedRange.Rows.Count
Step
lPageLength"
I have no idea where to go from here.
JB
"Ardus Petus" wrote:
Sub setPageBreaks()
Const lPageLength As Long = 85
Dim lRow As Long
ActiveWindow.View = xlPageBreakPreview
With ActiveSheet
.ResetAllPageBreaks
For lRow = 1 + lPageLength To UsedRange.Rows.Count Step
lPageLength
.HPageBreaks.Add befo=Rows(lRow)
Next lRow
End With
ActiveWindow.View = xlNormalView
End Sub
HTH
--
AP
"JAB" a écrit dans le message de news:
...
I need to have a page break every 85th row. I need this done
automatically,
because I have over 3800 rows. Any help is appreciated.
JB
Reply With Quote