|
我需要用宏一键打印表中黄色部分,表的格式都相同的,我本想用宏在每个表的最后面设置一个分页符,来达到目的,但是自动分页符打乱了我的计划,请高手指点。
Sub 其余()
Dim wrb1 As Range
Dim wrb2 As String
Dim wrb3 As Integer
Dim wrb4 As Integer
Dim wrb5 As Long
Dim wrb6 As Long
Set wrb1 = Cells.Find("其他", lookat:=xlPart, searchorder:=xlRows)
If Not wrb1 Is Nothing Then
wrb2 = wrb1.Address
Do
wrb3 = wrb1.Row
wrb4 = wrb1.Column
wrb5 = Cells(wrb3 - 3, wrb4 + 43)
Cells(wrb3 + 4, wrb4 + 22).PageBreak = xlPageBreakManual
Set wrb1 = Cells.FindNext(wrb1)
Loop While wrb1.Address <> wrb2
End If
End Sub
|
|