View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Apollyon[_2_] Apollyon[_2_] is offline
external usenet poster
 
Posts: 9
Default Help on VBA Page Breaks

The macro sets the next address using the "Range.Offset.Select" and
then uses this saved address to start the next report. It appears that
when I insert a manual page break and then select the activecell to set
the starting range that the effect of inserting the page break has
changed the stored address for the beginning of the next report. Here
is a snipet of the code I am using:

' Build first manifold report
If i = 1 Then
Range("A274").Select
ManifoldHeaderRange.Copy ActiveCell
Manifold_General_InspectRange.Copy ActiveCell.Offset(18, 0)
Range("A330").Select
ActiveCell.PageBreak = xlPageBreakManual
Range("A364").Select
Set NextAddress = ActiveCell
ActiveCell.PageBreak = xlPageBreakManual
ManifoldReport_Pointer = ManifoldReport_Pointer + 1
Else
NextAddress.Select
ManifoldHeaderRange.Copy ActiveCell
Manifold_General_InspectRange.Copy ActiveCell.Offset(18, 0)
ActiveCell.Offset(56, 0).Select
ActiveCell.PageBreak = xlPageBreakManual
ActiveCell.Offset(90, 0).Select
Set NextAddress = ActiveCell
ActiveCell.PageBreak = xlPageBreakManual
ManifoldReport_Pointer = ManifoldReport_Pointer + 1
End If