View Single Post
  #3   Report Post  
Steve O
 
Posts: n/a
Default

Thanks Dave..

In regardsto the message box do I need to add it after the cancel = true as
an if statement also. I not able to get the message box to appear when the
true condition exists.

"Dave Peterson" wrote:

How about:

Private Sub Workbook_BeforePrint(Cancel As Boolean)
If worksheets("sheet99").Range("A42") < 0 Then
cancel = true
end if
End Sub

Maybe adding a msgbox would help the user understand why his/her listings never
show up!


Steve O wrote:

Hello,

I'm looking for code to check a value in a cell and if that value is 0 then
continue to print. If the value is any number other than 0 then display a
message box stating that the sheet does not balance and let the user go back
to the sheet and fix. Here is the code I have so far with no success

Private Sub Workbook_BeforePrint(Cancel As Boolean)
If Range("A42") < 0 Then PrintOut = False
End Sub

Thanks for any input.
Steve


--

Dave Peterson