理论上应该先在每一页之后插入分节符,然后再调用修改每一节的页眉。没具体操作,你可以先尝试下这样做做看。
Sub 打印()
i = 1
With ActiveSheet.PageSetup
.CenterHeader = Cells(1, i).Value
End With
ActiveSheet.PrintOut From:=i, To:=i, Copies:=1
k = ExecuteExcel4Macro("GET.DOCUMENT(50)")
For i = 2 To k
With ActiveSheet.PageSetup
.CenterHeader = Cells(1, i).Value
End With
ActiveSheet.PrintOut From:=i, To:=i, Copies:=1
Next
End Sub