Page Break each Row

  • Thread starter Thread starter Ripper
  • Start date Start date
R

Ripper

Is there a way to force Excel to put a page break after every row that
contains something (anything) is the A column of that row. I don't need
Excel to put breaks on all the rows, just the ones that have information.

Excel 2002
 
Select column A then run this macro.

Sub InsertBreak()
Dim i As Long
For i = Columns(1).Rows.Count To 1 Step -1
If Selection(i).Row = 1 Then Exit Sub
If Not IsEmpty(Selection(i - 1)) Then
With Selection(i)
.PageBreak = xlPageBreakManual
End With
End If
Next
End Sub

Note: will take a while depending upon your used range in Column A


Gord Dibben MS Excel MVP
 
Back
Top