HPageBreaks.Add Method (Excel)

Office 2013 and later
GitHub-Mark-64px

Contribute to this content

Use GitHub to suggest and submit changes. See our guidelines for contributing to VBA documentation.

Adds a horizontal page break.

expression .Add(Before)

expression A variable that represents a HPageBreaks object.

Parameters

Name

Required/Optional

Data Type

Description

Before

Required

Object

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

Return Value

A HPageBreak object that represents the new horizontal page break.

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
Show: