Here is a subroutine to add page breaks and one to remove them
Note that the first one assumes your list is in column A of Sheet2; modify
code as needed
Sub insertBreaks()
lastrow = Cells(Cells.Rows.Count, "A").End(xlUp).Row
howmany = InputBox("How many rows on a page?")
Application.ScreenUpdating = False
For j = howmany To lastrow Step howmany
Worksheets("Sheet2").Rows(j).PageBreak = xlPageBreakManual
Next j
Application.ScreenUpdating = True
End Sub
Sub removeBreaks()
Worksheets("Sheet2").ResetAllPageBreaks
End Sub
New to VBA?
David McRitchie's site on "getting started" with VBA
Here is a subroutine to add page breaks and one to remove them
Note that the first one assumes your list is in column A of Sheet2; modify
code as needed
Sub insertBreaks()
lastrow = Cells(Cells.Rows.Count, "A").End(xlUp).Row
howmany = InputBox("How many rows on a page?")
Application.ScreenUpdating = False
For j = howmany To lastrow Step howmany
Worksheets("Sheet2").Rows(j).PageBreak = xlPageBreakManual
Next j
Application.ScreenUpdating = True
End Sub
Sub removeBreaks()
Worksheets("Sheet2").ResetAllPageBreaks
End Sub
New to VBA?
David McRitchie's site on "getting started" with VBA
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.