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? |
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? |
All times are GMT +1. The time now is 04:38 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com