Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default xlpagebreak Property

How do I use this property to find the address of automatic page breaks? Excel VBA help doesn't do a great job explaining this one

-Kerry
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default xlpagebreak Property

Kerry,

Sub test()
Dim hpb As HPageBreak

For Each hpb In Sheet1.HPageBreaks
If hpb.Type = xlPageBreakAutomatic Then
Debug.Print "Automatic: " & hpb.Location.Address
ElseIf hpb.Type = xlPageBreakManual Then
Debug.Print "Manual: " & hpb.Location.Address
End If
Next
End Sub



Rob

"Kerry" wrote in message
...
How do I use this property to find the address of automatic page breaks?

Excel VBA help doesn't do a great job explaining this one.

-Kerry



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default xlpagebreak Property

Kerry,

The Location property of the H/VPageBreak objects returns a Range
object reference to the location of the page break. From that,
you can use the Address property to get the address. The range
returned by Location is immediately below the page break.

Debug.Print ActiveSheet.HPageBreaks(1).Location.Address


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Kerry" wrote in message
...
How do I use this property to find the address of automatic

page breaks? Excel VBA help doesn't do a great job explaining
this one.

-Kerry



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
Forecasting Property Tax sfranger2003 Excel Discussion (Misc queries) 3 March 2nd 10 12:24 AM
Caption Property the dude Excel Discussion (Misc queries) 1 June 1st 06 10:23 AM
Precedents Property Derek[_6_] Excel Programming 1 November 8th 03 12:51 PM
VBA: using ignoreblank property chick-racer[_29_] Excel Programming 2 November 7th 03 09:29 PM
IndicatorColorIndex Property Leonard[_2_] Excel Programming 2 July 28th 03 01:07 AM


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