Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Page Break Object in VBA for Excel 95

7 views
Skip to first unread message

j.m...@netaccess.co.nz

unread,
Aug 11, 1997, 3:00:00 AM8/11/97
to

I am trying to return the Page Break Object in Excel 95 VBA, but I don't
know what it's called, or if it even exists.

In Excel 97 it is a property of a worksheet object called HPageBreak.
Excerpt from Excel 97 VB Help on HPageBreak:

Represents a horizontal page break. The HPageBreak object is a member of
the HPageBreaks collection. Using the HPageBreak Object: Use
HPageBreaks(index), where index is the index number of the page break, to
return an HPageBreak object. The following example changes the location
of horizontal page break one. Worksheets(1).HPageBreaks(1).Location =
Worksheets(1).Range("e5")

Does anyone know where this equivalent is in Excel 95?

-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet

John Green

unread,
Aug 13, 1997, 3:00:00 AM8/13/97
to

In article <8712805...@dejanews.com> on Mon, 11 Aug 1997 06:51:50
-0700 j.m...@netaccess.co.nz wrote:
<< I am trying to return the Page Break Object in Excel 95 VBA, but I
don't
know what it's called, or if it even exists. >>

The PageBreak object is new to Excel 97 and does not exist in Excel 95.
Instead, you can use the PageBreak property of the Range object, if you
are trying to set or remove manual page breaks, you can use:

Range("E5").PageBreak = xlManual
Range("E5").PageBreak = xlNone

You can test for page breaks with something like the following:

x = ActiveCell.EntireRow.PageBreak
y = ActiveCell.EntireColumn.PageBreak
If x = xlManual And y = xlManual Then
MsgBox "Manual Page Break"
End If

Hope this helps,

John Green
Sydney
Australia
Microsoft MVP - Excel


0 new messages