Automatically insert page break every 6 rows in excel doc

G

Guest

I have a very large excel document and I need to insert a page break, say
after a fixed number of rows eg 6 rows. To insert page break manually it will
take hours. Can anybody help ?
 
I

Ian

Try this:

Sub insert_page_breaks()
For r = 7 To 100 Step 6
Worksheets("Sheet1").Rows(r).PageBreak = xlPageBreakManual
Next
End Sub
 

Ask a Question

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.

Ask a Question

Top