Hi Folks,
I need to add a check to one of my printout macros.
If cell G5 or cell H17 or cell B42 have no data, then the macro should stop.
Any help appreciated.
:dunno
Printable View
Hi Folks,
I need to add a check to one of my printout macros.
If cell G5 or cell H17 or cell B42 have no data, then the macro should stop.
Any help appreciated.
:dunno
Hi,
Add this to the top of your code where it's desired ...
Code:If IsEmpty([G5]) Or IsEmpty([H17]) Or IsEmpty([B42]) Then Exit Sub
Try the following
Code:Sub DoPrint()
If [G5] = "" Or [H17] = "" Or [B42] = "" Then
Exit Sub
Else
MsgBox "Do Printing"
End If
End Sub
Assuming that I understand your criteria, try something like this:Quote:
Originally Posted by outrider
Code:If Cells(5, 7) = "" Or Cells(17, 8) = "" Or Cells(42, 2) = "" Then
MsgBox "stopping print macro because one or more key cells is blank"
Exit Sub
End If
Thanks for all the help, it's really appreciated.