ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Automatically insert page break every 6 rows in excel doc (https://www.excelbanter.com/excel-discussion-misc-queries/49572-automatically-insert-page-break-every-6-rows-excel-doc.html)

Icetea

Automatically insert page break every 6 rows in excel doc
 
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 ?

Ian

Try this:

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

--
Ian
--
"Icetea" wrote in message
...
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 ?





All times are GMT +1. The time now is 02:46 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com