How do you make a page break happen after every cell...copy?

V

vhd

I'm trying to make a page break happen after every cell ... the rowshave been merged (25/cell) and I want a page break every 25 rows. How do I get that to happen without inserting a page break manually every 25 rows?
 
D

Dave Peterson

A macro like this???

Option Explicit
Sub testme01()

Dim iRow As Long
Dim LastRow As Long

With ActiveSheet
LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row

For iRow = 26 To LastRow Step 25
.HPageBreaks.Add Before:=.Cells(iRow, "A")
Next iRow
End With

End Sub


If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm
 
Top