Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 04-29-2016, 05:39 AM
Manexcel Manexcel is offline Automatically adding page breaks after n rows Windows 10 Automatically adding page breaks after n rows Office 2016
Novice
Automatically adding page breaks after n rows
 
Join Date: Apr 2016
Posts: 1
Manexcel is on a distinguished road
Default Automatically adding page breaks after n rows


I have a workbook that contains around 14 worksheets - static data, Year overview, and 12 monthly worksheets.

The 'year overview' worksheet contains a row for each date of the year. However, each date will contain a minimum of 2 rows per day, but can go up to around 6 rows for any given date. Therefore this worksheet can contain around 1000 rows.

For each of the 12 monthly worksheets, the data for say, May, is copied onto its respective monthly worksheet.

What I am trying to achieve is to automatically implement page breaks on the 'Year Overview' and each of the individual '12 monthly' worksheets - say after row 15(variable if possible). This could be day 7 or day 8 for that month depending on the number of rows added for any given day(s).

I also want to ensure that no date is split across the page break.

Can you please assist in providing automation to automatically add page breaks after nn rows and ensure that no date is split across a page break.

I thank you in anticipation.


Col. A contains the date
Col. B to ?. data from static data worksheet
Reply With Quote
  #2  
Old 05-15-2016, 08:03 PM
BobBridges's Avatar
BobBridges BobBridges is offline Automatically adding page breaks after n rows Windows 7 64bit Automatically adding page breaks after n rows Office 2010 32bit
Expert
 
Join Date: May 2013
Location: USA
Posts: 700
BobBridges has a spectacular aura aboutBobBridges has a spectacular aura about
Default

Well, it seems to me you need to do three things:
1) Determine how to set a page break. I never use them, myself—all the tools I create are for use on the PC—so I guess you'd have to use the macro recorder to figure out how this works.

2) Have your program count lines from the top of the "page". When it's time to set a page break, do so (see above) and start the count over from that point.

3) But as to the decision about where to set the break—which I imagine is the real crux of your question—it depends: Do you want to assume that every group is six lines long, or do you want to go to the extra trouble of counting each group as you encounter it and decide whether each group can fit on the current page? The latter is more complicated but more satisfying to the self-approval :-), a heady but dangerous draught.

Which would you rather do? On your choice depends the logic that must follow.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Automatically adding page breaks after n rows Automatically adding new rows based on form field tejaspareek Word VBA 4 04-17-2015 05:35 AM
Automatically adding page breaks after n rows Hidden page breaks and section breaks jrasicmark Word 3 06-02-2014 11:28 PM
Automatically adding page breaks after n rows Adding Rows to a Table SuzeG Word VBA 8 01-02-2014 08:05 AM
Automatically adding page breaks after n rows Prevent Outlook from adding line breaks vektor Outlook 4 02-14-2012 02:16 PM
Deleted Section Breaks Changes Page Breaks Brantnshellie Word 0 02-01-2009 09:22 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:33 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft