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: 39
Default return pageBreaks


Here is a simple code I've written that returns page break locations, but
only those page breaks that I've inserted manually. It won't return page
breaks that Excel inserts automatically. If I try to get these page breaks I
get the message, "subscript out of range. Can anybody tell me why? And how to
use this type of simple code to get automatic page breaks?

Sub pageBreakA1C1()

'will find only those page breaks that were manually inserted
'won't find those inserted automaticall by Excel

Dim myPageBreakA1C1
myPageBreakA1C1 =
ActiveWorkbook.Worksheets(1).HPageBreaks(2).Locati on.Address(, , xlR1C1)
Range("A3").Select
Selection = myPageBreakA1C1
Range("A4").Select
Range("A3").ClearContents

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
Deleting PageBreaks asmenut Excel Programming 0 November 16th 05 10:37 PM
Deleting PageBreaks Gary''s Student Excel Programming 0 November 16th 05 10:37 PM
Pagebreaks are not made Jos Vens Excel Programming 7 January 9th 05 07:16 AM
pagebreaks Yiannis H. Economides Excel Programming 1 February 19th 04 04:03 PM
Excel pagebreaks Don Nicholson Excel Programming 0 September 15th 03 05:44 PM


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