ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Pagebreak function problem (https://www.excelbanter.com/excel-programming/331386-pagebreak-function-problem.html)

quartz[_2_]

Pagebreak function problem
 
I am using Office 2003 on WindowsXP.

The following function should return true if a page break exists at a given
row:

Public Function PageBreakHorizontalExists(argRow As Long) As Boolean
'RETURNS TRUE IF A PAGE BREAK EXISTS ABOVE THE ROW SUPPLIED
If Rows(argRow).PageBreak = xlNone Then PageBreakHorizontalExists = False
Else PageBreakHorizontalExists = True
End Function

However, in a sheet where a user has inserted a manual break that covers
"C223:H223" this function fails to return true. Can someone please correct
this function so that it will identify manual page breaks such as the one
described?

Thanks much in advance.

quartz[_2_]

Pagebreak function problem
 
Update to previous post:

This function works for "new" spreadsheets, but not older ones created in
Office 2000 (or older). Any ideas?

"quartz" wrote:

I am using Office 2003 on WindowsXP.

The following function should return true if a page break exists at a given
row:

Public Function PageBreakHorizontalExists(argRow As Long) As Boolean
'RETURNS TRUE IF A PAGE BREAK EXISTS ABOVE THE ROW SUPPLIED
If Rows(argRow).PageBreak = xlNone Then PageBreakHorizontalExists = False
Else PageBreakHorizontalExists = True
End Function

However, in a sheet where a user has inserted a manual break that covers
"C223:H223" this function fails to return true. Can someone please correct
this function so that it will identify manual page breaks such as the one
described?

Thanks much in advance.


Jim Cone

Pagebreak function problem
 
Try adding data to any cell below the page break.
Then try your routine again.

Jim Cone
San Francisco, USA


"quartz" wrote in message
...
I am using Office 2003 on WindowsXP.

The following function should return true if a page break exists at a given
row:
Public Function PageBreakHorizontalExists(argRow As Long) As Boolean
'RETURNS TRUE IF A PAGE BREAK EXISTS ABOVE THE ROW SUPPLIED
If Rows(argRow).PageBreak = xlNone Then PageBreakHorizontalExists = False
Else PageBreakHorizontalExists = True
End Function

However, in a sheet where a user has inserted a manual break that covers
"C223:H223" this function fails to return true. Can someone please correct
this function so that it will identify manual page breaks such as the one
described?
Thanks much in advance.


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com