G
Guest
I have a small piece of code in an Excel sheet which validates whether a
field has been completed and then allow a print if it has been. Here's the
code:
Private Sub CheckPrint_Click()
If Worksheets("Checks").Range("D33").Value = "No" Then
ActiveSheet.PrintOut
Else
MsgBox "There is an error on form - check all required fields (marked in
red) have been completed properly and try again"
End If
End Sub
- Problem is, users are saving a copy of the main sheet (SOS) and then
printing - hence they get an error as the macro cannot complete if they only
save the SOS worksheet (the Checks sheet is hidden). Is there a way of
telling Excel that if the page does not exist, carry on to complete the task
(printing) anyway?
field has been completed and then allow a print if it has been. Here's the
code:
Private Sub CheckPrint_Click()
If Worksheets("Checks").Range("D33").Value = "No" Then
ActiveSheet.PrintOut
Else
MsgBox "There is an error on form - check all required fields (marked in
red) have been completed properly and try again"
End If
End Sub
- Problem is, users are saving a copy of the main sheet (SOS) and then
printing - hence they get an error as the macro cannot complete if they only
save the SOS worksheet (the Checks sheet is hidden). Is there a way of
telling Excel that if the page does not exist, carry on to complete the task
(printing) anyway?