Add Method (HPageBreaks Collection)

Applies To

HPageBreaks collection object.

Description

Adds a horizontal page break. Returns an HPageBreak object.

Syntax

object.Add(Before)

object Required. An expression that returns an HPageBreaks object.

Before Required Object. A Range object. The range above which the new page break will be added.

Example

This example adds a horizontal page break above cell F25 and adds a vertical page break to the left of this cell.

With Worksheets(1)
    .HPageBreaks.Add .Range("F25")
    .VPageBreaks.Add .Range("F25")
End With