G
Guest
Hi I use the following macro below to print only desired sheets,
Sub PrintButton_Click()
'to start stop screen updating (stops screen flicker)
Application.ScreenUpdating = False
Sheets("Cover").Select
Application.Dialogs(xlDialogPrint).Show
Sheets("sheet2").Select
If Range("Calcs!i1") = True Then
ActiveWindow.SelectedSheets.PrintOut Copies:=1
End If
Sheets("sheet3").Select
If Range("Calcs!f1") = True Then
ActiveWindow.SelectedSheets.PrintOut Copies:=1
End If
'etc etc
End sub
This works as required!
This macro is linked to a control button, when pressed the user sees the
standard excel print screen where they can select their printer, and then
print, no problems. If however the user decides for some reason to then press
the cancel button, I you get a run error, I was wondering if it would be
possible such if they press cancel, it goes back to the sheet called cover
instead of getting the run error?
Sub PrintButton_Click()
'to start stop screen updating (stops screen flicker)
Application.ScreenUpdating = False
Sheets("Cover").Select
Application.Dialogs(xlDialogPrint).Show
Sheets("sheet2").Select
If Range("Calcs!i1") = True Then
ActiveWindow.SelectedSheets.PrintOut Copies:=1
End If
Sheets("sheet3").Select
If Range("Calcs!f1") = True Then
ActiveWindow.SelectedSheets.PrintOut Copies:=1
End If
'etc etc
End sub
This works as required!
This macro is linked to a control button, when pressed the user sees the
standard excel print screen where they can select their printer, and then
print, no problems. If however the user decides for some reason to then press
the cancel button, I you get a run error, I was wondering if it would be
possible such if they press cancel, it goes back to the sheet called cover
instead of getting the run error?