The following code when placed in a simple 3 worksheet workbook works perfect. Unless there is a value greater than 0 in A1 the worksheet will not print. Am trying to use in a more complicated workbook and is not working? Am wanting to apply this logic to Sheet38, Sheet39, Sheet40, Sheet41, Sheet18 without success.
Code could either be added to the code that selects and prints these 5 sheets or as note below. Assistance appreciated.....
Private Sub Workbook_BeforePrint(Cancel As Boolean)
With Sheet1
If Not .Range("A1").Value > 0 Then
Cancel = True
End If
End With
End Sub
Code could either be added to the code that selects and prints these 5 sheets or as note below. Assistance appreciated.....
Private Sub Workbook_BeforePrint(Cancel As Boolean)
With Sheet1
If Not .Range("A1").Value > 0 Then
Cancel = True
End If
End With
End Sub