HPageBreak.Location property (Excel)

Returns or sets the cell (a Range object) that defines the page-break location. Horizontal page breaks are aligned with the top edge of the location cell. Read/write Range.

Syntax

expression.Location

expression A variable that represents an HPageBreak object.

Example

This example sets the horizontal page-break location. Note that you must be in Page Break Preview mode in order to set it.

Set Worksheets(1).HPageBreaks(1).Location = Worksheets(1).Range("e5")

Note

The Location property can only be used to set the horizontal page-break location. To change the location of a VPageBreak, you must use VPageBreak.Dragoff.

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.