View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Trevor Williams Trevor Williams is offline
external usenet poster
 
Posts: 181
Default 2007: How to disable printing when a specific cell is blank

Hi Aaron

add this to your Workbook module

Private Sub Workbook_BeforePrint(Cancel As Boolean)
If Range("A1") = "" Then
MsgBox ("STOP")
Cancel = True
End If
End Sub

HTH
Trevor Williams

"Aaron" wrote:

Hello,

I am trying to disable all printing when a specific cell on a worksheet is
blank. Meaning there is no way a user can print anything from the worksheet
until the cell has been filled.
Any code samples or examples would be both appreciated and helpful. This
example needs to work for Excel 2007, working for any other versions is a
bonus.

Thanks for the help in advance,
Aaron