Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default how to set page break for continuous numerical sheet printing

I am printing endless consecutive numbers and I want to set the page break at
the same place each time automatically.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,104
Default how to set page break for continuous numerical sheet printing

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

http://www.mvps.org/dmcritchie/excel/getstarted.htm

Debra Dalgleish's "Adding Code to a Workbook"

http://www.contextures.com:80/xlvba01.html
best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"Woodbug" wrote in message
...
I am printing endless consecutive numbers and I want to set the page break
at
the same place each time automatically.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I use Page Break Preview without seeing "PAGE" in sheet? Aditya Thakur Excel Discussion (Misc queries) 1 October 7th 08 11:38 PM
Macro to determine row of page break on modified presentation sheet? pallaver Excel Discussion (Misc queries) 2 July 21st 08 06:05 AM
setting page break when printing Amy Excel Discussion (Misc queries) 2 October 19th 07 09:28 PM
Vertic Printing Page Break ? Robert11 New Users to Excel 1 December 24th 06 03:24 PM
printing - creating new files on each page break Tere Gardner Excel Worksheet Functions 4 May 4th 05 09:12 PM


All times are GMT +1. The time now is 04:26 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"