title: Inserting Page Break With VBA
body: <p>I'm trying to insert page breaks that will allow every 8 rows of the excel sheet to be printed. The problem that I am having is that when using the "ActiveWindow.View = xlPageBreakPreview" method, the first page break occurs after row 10, and then from there on out, occurs every 8 rows. Here is the code that I am currently using:</p>
  
  <pre><code>ActiveSheet.ResetAllPageBreaks
  ActiveWindow.View = xlPageBreakPreview
  ActiveSheet.VPageBreaks(2).DragOff Direction:=xlToRight, RegionIndex:=1
  ActiveSheet.VPageBreaks(1).DragOff Direction:=xlToRight, RegionIndex:=1
  
  With ActiveSheet.PageSetup
      .CenterHeader = "&amp;""Chiller""&amp;75WOC"
      .CenterFooter = "&amp;""Chiller""&amp;75 PLACARD"
      .PrintQuality = 600
      .CenterHorizontally = True
      .CenterVertically = True
      .Orientation = xlLandscape
      .PaperSize = xlPaperLetter
      .Zoom = 45
      .LeftMargin = Application.InchesToPoints(0)
      .RightMargin = Application.InchesToPoints(0)
      .TopMargin = Application.InchesToPoints(0.75)
      .BottomMargin = Application.InchesToPoints(0.75)
      .HeaderMargin = Application.InchesToPoints(0.3)
      .FooterMargin = Application.InchesToPoints(0.3)
  End With
  </code></pre>
  
  <p>I tried adding this loop to manually add the page break, but it bogged the code way down, so I was wondering if there is a simpler solution that I am not aware of.</p>
  
  <p>Any help is much appreciated.</p>