2017-10-09 2 views
0

私は約10枚のワークシートを持っています。私は連続したページ番号を付ける必要があります。ワークシートAが10ページある場合と同様に、ページ番号1〜10を入れ、シート番号11からページBを開始する必要があります。VBA - 特定のシートの順次ページ番号の設定

私はすべてのワークシートのforループを使用してページ番号を入れています。部分的なコード:

For Each s In Worksheets 
    s.Activate 
    Application.PrintCommunication = False 
    With ActiveSheet.PageSetup 
     .CenterFooter = "&""Arial""&12" & "Page &P" 
    End With 
    Application.PrintCommunication = True 
Next s 

ここでは、用紙の数枚の間にページ番号を印刷したくありません。これらのワークシートからページ番号が印刷されないようにするにはどうすればよいですか?

ありがとうございます!

答えて

0

ちょうど空間枚をスキップ:

Sub dural() 
For Each s In Worksheets 
    If s.Name = "Special1" Or s.Name = "Special2" Then 
    Else 
     s.Activate 
     Application.PrintCommunication = False 
     With ActiveSheet.PageSetup 
      .CenterFooter = "&""Arial""&12" & "Page &P" 
     End With 
     Application.PrintCommunication = True 
    End If 
Next s 
End Sub 
+0

こんにちはゲイリーの学生、私はすでに場合の条件を入れています。しかしそれはまだそれらのページを考慮する。これらのページにはページ番号は印刷されませんが、これらのシートを含めてページ番号がカウントされます。 –

関連する問題