Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 72
Default What is the location of my first horizontal page break?

I have a macro that inserts lines to keep text together, so that a
paragraph does not get split between two pages. It works when I hard
code the number of line per page, but I have the fit to one page wide
property set, so that number changes. Is there a way I can find out
what row contains the first horizonal page break?



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,173
Default What is the location of my first horizontal page break?

Claud

More checking may be necessary to check you have one to avoid a 'subscript
out of range error 9'

Sub FindHPageBreak()
Dim wks As Worksheet
Dim lRow As Long
Set wks = ActiveSheet
lRow = wks.HPageBreaks(1).Location.Row
End Sub

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
HIS


"Claud Balls" wrote in message
...
I have a macro that inserts lines to keep text together, so that a
paragraph does not get split between two pages. It works when I hard
code the number of line per page, but I have the fit to one page wide
property set, so that number changes. Is there a way I can find out
what row contains the first horizonal page break?



*** Sent via Developersdex
http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



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
Excel 2007 Page Break Adjustments causes a page break each cell BKaufman Excel Worksheet Functions 2 September 10th 10 05:02 AM
How do I do page breaks when view menu doesnt page break preview HeatherF55 Excel Discussion (Misc queries) 0 September 21st 07 04:24 AM
change and/or remove page number watermark in page break preview juga Excel Discussion (Misc queries) 2 December 25th 06 10:15 AM
adding a new page break to an existing page break Edward Letendre Excel Discussion (Misc queries) 1 March 6th 05 09:29 AM
lower horizontal page break will not move Pauline Excel Discussion (Misc queries) 4 February 27th 05 05:07 AM


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