Excel表格批量添加分页符
(2024-02-27 20:47:11)分类: 工作相关 |
Excel表格上面的分页符是作为打印一页的分隔标志。如下图所示,每十行作为一页打印输出(即:添加一条分页符)。
Sub Fenyefu()
Dim i, j
i = 1
Set mysheet1 =
ThisWorkbook.Worksheets("Sheet1")
For j = 1 To 1000
i = i + 10
mysheet1.HPageBreaks.Add Before:=mysheet1.Cells(i,
1)
Next
End Sub