HPageBreaks 方法 (Excel)HPageBreaks.Add method (Excel)

添加水平分页符。Adds a horizontal page break.

语法Syntax

表达式(之前)expression.Add (Before)

_表达式_一个代表**HPageBreaks** 对象的变量。expression A variable that represents an HPageBreaks object.

参数Parameters

名称Name 必需/可选Required/Optional 数据类型Data type 说明Description
BeforeBefore 必需Required ObjectObject 一个**Range** 对象。A Range object. 新的分页符将添加到该区域上方。The range above which the new page break will be added.

返回值Return value

一个代表新的水平分页符的**HPageBreak** 对象。An HPageBreak object that represents the new horizontal page break.

示例Example

本示例在单元格 F25 上方添加水平分页符,在其左侧添加垂直分页符。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

支持和反馈Support and feedback

有关于 Office VBA 或本文档的疑问或反馈?Have questions or feedback about Office VBA or this documentation? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.