Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
conditional printing
Is it possible to prevent printing based on zero value in a particular cell?
|
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
conditional printing
Put this in the ThisWorkbook module. Change sheet and cell to suit.
Private Sub Workbook_BeforePrint(Cancel As Boolean) With Sheets("sheet6") If Len(Trim(.Range("c1"))) < 1 Then Cancel = True End With End Sub -- Don Guillett Microsoft MVP Excel SalesAid Software "Conditional printing" <Conditional wrote in message ... Is it possible to prevent printing based on zero value in a particular cell? |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
conditional printing
You can verify the value in the cell with the workbooks BeforePrint event.
Press Alt+F11 to open the Visual Basic Editor. In the project Explorer in the upper-left pane, doiuble click on the ThisWorkbook icon. In the combobox at the top of the module on the left, change the object to workbook, and the in the combobox on the right change the event to the BeforePrint event. Use something like to following code to control the printing, substituting the worksheet index number with either the name of the worksheet as a string or its index number, and the cell address A1 to the cell that contains the value you wish to verify: Private Sub Workbook_BeforePrint(Cancel As Boolean) If ThisWorkbook.Worksheets(1).Range("A1").Value = 0 Then MsgBox "There is nothing to print at this time." End If Cancel = True End Sub -- Kevin Backmann "Conditional printing" wrote: Is it possible to prevent printing based on zero value in a particular cell? |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
conditional printing
Paste this into your ThisWorkbook Code Window << Change as necessary
Private Sub Workbook_BeforePrint(Cancel As Boolean) If Range("C4") = "" Then MsgBox "Cell C4 is empty" Cancel = True End If End Sub "Conditional printing" wrote: Is it possible to prevent printing based on zero value in a particular cell? |
#5
Posted to microsoft.public.excel.misc
|
|||
|
|||
conditional printing
better make that line...
If Range("C4") = 0 Then Sorry "Conditional printing" wrote: Is it possible to prevent printing based on zero value in a particular cell? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Conditional auto printing in excell? | Excel Worksheet Functions | |||
Conditional printing based on cells greater than zero | Excel Worksheet Functions | |||
Conditional Printing | Excel Discussion (Misc queries) | |||
Printing conditional images | Excel Discussion (Misc queries) | |||
Printing of cells in Excel with conditional equations? | Excel Discussion (Misc queries) |