Pagebreak function problem

G

Guest

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.
 
G

Guest

Update to previous post:

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

Jim Cone

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

Jim Cone
San Francisco, USA


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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top