HPageBreaks.Add 方法 (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.