Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Junior Member
 
Posts: 3
Default Adding multiple page breaks - at start of each day

Hi all,

I'm hoping to find a simple way to add page breaks in my template to the start of each day, to make it more printer friendly.

Originally, I had planned to use =IF(b1b2,"Page",1) command in column D to determine where I wanted the page breaks to be, then use Go to - Constants - Text, to add page breaks on each "Page" cell. However, I only get a page break in the first instance.


Day 1 1737 Data 1
Day 1 1752 Data 1
Day 1 1800 Data 1
Day 1 1827 Data 1
Day 1 1830 Data 1
Day 1 1930 Data 1
Day 1 2030 Data 1
Day 1 2230 Data 1
Day 1 2330 Data 1
Day 2 0000 Data Page
Day 2 0030 Data 1
Day 2 0100 Data 1
Day 2 0200 Data 1
Day 2 0230 Data 1
Day 2 0300 Data 1


I'm hoping someone here knows a simple way to accomplish this, preferably without resorting to VB scripting, as I am a VB noob.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,514
Default Adding multiple page breaks - at start of each day

Hate-Excel-Need was thinking very hard :
Hi all,

I'm hoping to find a simple way to add page breaks in my template to the
start of each day, to make it more printer friendly.

Originally, I had planned to use =IF(b1b2,"Page",1) command in column D
to determine where I wanted the page breaks to be, then use Go to -
Constants - Text, to add page breaks on each "Page" cell. However, I
only get a page break in the first instance.


Day 1 1737 Data 1
Day 1 1752 Data 1
Day 1 1800 Data 1
Day 1 1827 Data 1
Day 1 1830 Data 1
Day 1 1930 Data 1
Day 1 2030 Data 1
Day 1 2230 Data 1
Day 1 2330 Data 1
Day 2 0000 Data Page
Day 2 0030 Data 1
Day 2 0100 Data 1
Day 2 0200 Data 1
Day 2 0230 Data 1
Day 2 0300 Data 1


I'm hoping someone here knows a simple way to accomplish this,
preferably without resorting to VB scripting, as I am a VB noob.


Have you tried using PageBreak Preview?

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,872
Default Adding multiple page breaks - at start of each day

Hi,

Am Thu, 19 Apr 2012 06:28:20 +0000 schrieb Hate-Excel-Need:

Originally, I had planned to use =IF(b1b2,"Page",1) command in column D
to determine where I wanted the page breaks to be, then use Go to -
Constants - Text, to add page breaks on each "Page" cell. However, I
only get a page break in the first instance.


try:

Sub PageBreaks()
Dim LRow As Long
Dim i As Long

LRow = Cells(Rows.Count, 1).End(xlUp).Row
For i = 1 To LRow
If Cells(i + 1, 1) < Cells(i, 1) Then
With ActiveSheet
.HPageBreaks.Add Range("A" & i + 1)
End With
End If
Next
End Sub


Regards
Claus Busch
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2
  #4   Report Post  
Junior Member
 
Posts: 3
Default

Quote:
Originally Posted by Claus Busch View Post
Hi,

Am Thu, 19 Apr 2012 06:28:20 +0000 schrieb Hate-Excel-Need:

Originally, I had planned to use =IF(b1b2,"Page",1) command in column D
to determine where I wanted the page breaks to be, then use Go to -
Constants - Text, to add page breaks on each "Page" cell. However, I
only get a page break in the first instance.


try:

Sub PageBreaks()
Dim LRow As Long
Dim i As Long

LRow = Cells(Rows.Count, 1).End(xlUp).Row
For i = 1 To LRow
If Cells(i + 1, 1) < Cells(i, 1) Then
With ActiveSheet
.HPageBreaks.Add Range("A" & i + 1)
End With
End If
Next
End Sub


Regards
Claus Busch
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2
Thanks Claus,

But I'm afraid that's mostly ancient greek to me. Any chance you could give me some explanation as to how that works, and how to apply it?

Thanks
  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,872
Default Adding multiple page breaks - at start of each day

Hi,

Am Mon, 23 Apr 2012 07:50:05 +0000 schrieb Hate-Excel-Need:

But I'm afraid that's mostly ancient greek to me. Any chance you could
give me some explanation as to how that works, and how to apply it?


press ALT+F11, make a right-click on your project and choose "Insert
Modul", copy the code into the code window.
Back in Excel you can run the macro.


Regards
Claus Busch
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2
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
Excel 2007 adding page breaks David L[_2_] Excel Discussion (Misc queries) 0 December 11th 08 08:44 PM
Excel 2003 adding page breaks Gary Excel Discussion (Misc queries) 2 October 13th 08 02:49 PM
Adding page breaks conditionally RITCHI[_2_] Excel Programming 1 June 20th 08 07:00 PM
Multiple Page Breaks Susan Excel Discussion (Misc queries) 4 June 29th 07 10:27 PM
Insert Multiple Page Breaks heater Excel Worksheet Functions 1 September 13th 06 10:35 PM


All times are GMT +1. The time now is 12:33 PM.

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"