我一直在使用 VBA 工作表打印多个工作表的代码,条件为 Visible=True 并排除特定工作表。我哪儿也去不了。
Sub Printetail()
'
' PrintDetail Macro
'
Dim wsSheet As Worksheet
If Not wsSheet Is Nothing Then
If wsSheet.Visible = True
And wsSheet.CodeName <> "EstimateBasis"
And wsSheet.CodeName <> "CashFlow"
And wsSheet.CodeName <> "MaterialPVTable"
And wsSheet.CodeName <> "Material"
And wsSheet.CodeName <> "Instruction"
And wsSheet.CodeName <> "DebugSheet"
And wsSheet.CodeName <> "StateLocalTax"
And wsSheet.CodeName <> "Referene"
Then
'???
End If
If wsSheet.CodeName = "ProjectInput" Then
wsSheet.PageSetup.CenterFooter = ActiveSheet.Range("C6").Text & _
" -Estimate Date:" & _
ActiveSheet.Range("F2").Text & _
" -Gate:" & _
ActiveSheet.Range("F4").Text & _
" -Rev No." & _
ActiveSheet.Range("F5").Text
wsSheet.PrintOut Copies:=1, Collate:=True, IgnorePrintAreas:=False
Else
wsSheet.Visible = True
wsSheet.PrintOut Copies:=1, Collate:=True, IgnorePrintAreas:=False
End If
End If
End Sub