|
本帖最后由 网海遨游 于 2020-2-9 10:16 编辑
这样行不?家里无打印机,未测试,请楼主自行测试.
Sub 打印海事()
If MsgBox("注意:您即将打印包含【海事】的工作表", 36, "温馨提示……") = 7 Then Exit Sub
For Each sht In Sheets
If sht.Name Like "*" & "海事" & "*" Then
sht.PrintOut Copoes:=Sheets("基础信息").Cells(23, 2).Value '打印份数
End If
Next sht
End Sub
Sub 打印非海事()
If MsgBox("注意:您即将打印不包含【海事】的工作表", 36, "温馨提示……") = 7 Then Exit Sub
For Each sht In Sheets
If Not sht.Name Like "*" & "海事" & "*" And sht.Name <> "基础信息" Then
sht.PrintOut Copoes:=Sheets("基础信息").Cells(25, 2).Value '打印份数
End If
Next sht
End Sub
|
|