LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Formating Print Margins

Ok I know this code is wrong and correct to an extent. On first run (on
any particular sheet) it come up with an error on the SET and just
breaks the page into 3. on the second run it sets the page breaks.

pretty much what i am tring to do is get it so this macro will be
assigned to a buttn you press the button and regardless of what the
users have done to the print layout it will set it to 3 pages high with
the pages breaks in the correct places.

Sub actuals()

Sheet12.PageSetup.PrintArea = "$A$1:$AQ$215"
With Sheet12.PageSetup
.FitToPagesWide = 1
.FitToPagesTall = 3
End With
Sheet12.ResetAllPageBreaks

Sheet12.HPageBreaks(1).Location = Range("A68", "A141")
Sheet12.HPageBreaks(2).Location = Range("A141", "A215")

Set Sheet12.HPageBreaks(1).Location = Range("A68", "A141")
Set Sheet12.HPageBreaks(2).Location = Range("A141", "A215")

End Sub

 
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
Margins & print preview Meebers Excel Worksheet Functions 1 August 9th 07 10:38 PM
Print Blank Pgs - Preview margins outside print range dsm Excel Discussion (Misc queries) 0 October 25th 06 06:17 PM
How do I change print margins? BuniDyck Excel Discussion (Misc queries) 1 December 9th 05 02:46 PM
Excel Print Margins Adam S. Setting up and Configuration of Excel 2 October 25th 05 12:14 AM
Print margins on forms lchu80 Excel Discussion (Misc queries) 1 December 8th 04 11:01 PM


All times are GMT +1. The time now is 02:10 AM.

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

About Us

"It's about Microsoft Excel"