0

Excel (Office 2010) では、同じフッターで横向きに印刷しています。ブックを縦から横に変更するマクロを作成しましたが、Excel/VB はマクロを使用してページのフッターを編集することを好まないようです。

おそらくVBコードの回避策を使用して、マクロでフッターを編集できますか?

4

1 に答える 1

2

マクロを記録しようとしましたか?これをクリーンアップしましたが、これは Excel 2003 から直接取得したものです

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

私が理解していない他の問題がない限り

于 2012-07-16T23:48:07.800 に答える