prevent page printout

  • Thread starter Thread starter kurt
  • Start date Start date
K

kurt

Hello

I have been looking in the variabel list to find a variable that
prevent printing out a sheet.

If there isn't any variable to prevent this, does anyone have a good
Idea to prevent print out a sheet???

Anyone know about this

Regards

Kurt
 
Hi Kurt,

Try:

'=============>>
Private Sub Workbook_BeforePrint(Cancel As Boolean)
Cancel = ActiveSheet.Name = "Sheet1" '<<==== CHANGE
End Sub
'<<=============

This is workbook event code and should be pasted into the workbook's
ThisWorkbook module *not* a standard module or a sheet module:

Right-click the Excel icon on the worksheet
(or the icon to the left of the File menu if your workbook is maximised)

Select 'View Code' from the menu and paste the code.

Alt-F11 to return to Excel.
 
Hello
You can try this workbook event:
Private Sub Workbook_BeforePrint(Cancel As Boolean)
If ActiveSheet.Name = "Sheet1" Then Cancel = True
End Sub

HTH
Cordially
Pascal
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top