使用Excel(Office 2010),我使用相同的页脚和横向打印。我制作了一个宏,将工作簿从纵向更改为横向,但Excel / VB似乎不喜欢用宏编辑页面的页脚。
您是否可以使用宏编辑页脚,可能使用VB代码解决方法或其他方式?
答案 0 :(得分:2)
Sub setFooter()
On Error GoTo HandleErrors
'@JimmyPena pointed out an msdn example that seems useful to incorporate
Application.PrintCommunication = False
With ActiveSheet.PageSetup
.Orientation = xlLandscape
.LeftFooter = "What"
.CenterFooter = "a"
.RightFooter = "Header"
End With
Application.PrintCommunication = True
ExitHere:
Exit Sub
HandleErrors:
' If an error occurs, make sure you reset
' print communications.
Application.PrintCommunication = True
Resume ExitHere
End Sub
除非你有其他问题我不理解