|
- Sub 打印后清空()
- On Error GoTo ErrorHandler
- If MsgBox("点 确定 后开始打印", vbInformation + vbYesNo) = vbNo Then
- Exit Sub
- End If
-
- With Application
- .ScreenUpdating = False
- .DisplayAlerts = False
- .EnableEvents = False
- .Calculation = xlCalculationManual
- End With
- ActiveSheet.PrintOut
- Range("B3,C4,b4,D3,D4,f3,h3,g4,a6:e10,a14:g18,b20,b23,b24,f23").Value = ""
- With Application
- .ScreenUpdating = True
- .DisplayAlerts = True
- .EnableEvents = True
- .Calculation = xlCalculationAutomatic
- End With
- MsgBox "打印完成,数据清除完毕"
- Exit Sub
- ErrorHandler:
- MsgBox Err.Number & vbCrLf & _
- Err.Description
- With Application
- .ScreenUpdating = True
- .DisplayAlerts = True
- .EnableEvents = True
- .Calculation = xlCalculationAutomatic
- End With
- End Sub
复制代码 |
|