Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 97
Default Idiot can't insert page breaks.

Perhaps not an idiot but, I've hit a brick wall trying to insert a page
break with code.



The problem

300 plus rows of data requiring splitting when data in a certain row chages.
On change, insert new line, create a heading summarising data below, format
the heading and insert a page break



Kept getting getting no result trying different method with HPageBreak.
Examples



ActiveSheet.HPageBreaks.Add Befo=Activecell.offset(1)



Selection.offset(1).select

ActiveSheet.HPageBreaks.Add Befo=Activecell

Selection.offset(-1).select





No problem thinks I. Just record a macro and copy code from there.

Steps:

start recorder:

Clear all breaks

Select cell

Insert page break

stop recorder



The recorder generated code but, in pagebreak view I could not see any
break inserted. In print preview, ditto. Started gettiing annoyed by now.
Tried manually dragging breaks into pagebreak view. Voila. Lines appear.
However, the breaks don't appear in print preview.



Just tested code at home. You guessed it. Breaks appear.



What may be causing the lack of breaks in Excel at work? Page setup,
perhaps?

What's the best method to insert a break away from the selected cell?


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 97
Default Idiot can't insert page breaks.

Idiot recovers the power of thought:

With ActiveSheet.PageSetup
....
.FitToPagesTall = False
....
End With




"Steve" <No Spam wrote in message ...
Perhaps not an idiot but, I've hit a brick wall trying to insert a page
break with code.



The problem

300 plus rows of data requiring splitting when data in a certain row
chages. On change, insert new line, create a heading summarising data
below, format the heading and insert a page break



Kept getting getting no result trying different method with HPageBreak.
Examples



ActiveSheet.HPageBreaks.Add Befo=Activecell.offset(1)



Selection.offset(1).select

ActiveSheet.HPageBreaks.Add Befo=Activecell

Selection.offset(-1).select





No problem thinks I. Just record a macro and copy code from there.

Steps:

start recorder:

Clear all breaks

Select cell

Insert page break

stop recorder



The recorder generated code but, in pagebreak view I could not see any
break inserted. In print preview, ditto. Started gettiing annoyed by now.
Tried manually dragging breaks into pagebreak view. Voila. Lines appear.
However, the breaks don't appear in print preview.



Just tested code at home. You guessed it. Breaks appear.



What may be causing the lack of breaks in Excel at work? Page setup,
perhaps?

What's the best method to insert a break away from the selected cell?



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 insert page breaks in .txt for use in excel? JohnK Excel Discussion (Misc queries) 2 January 19th 07 11:24 PM
Insert Multiple Page Breaks heater Excel Worksheet Functions 1 September 13th 06 10:35 PM
insert page breaks NickHK Excel Programming 2 September 22nd 04 02:21 PM
insert page breaks Bruce Excel Programming 0 September 22nd 04 10:45 AM
insert page breaks every 43 lines chase Excel Programming 2 August 6th 03 03:42 PM


All times are GMT +1. The time now is 09:32 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"