Stop printing


Posted by KCY on January 27, 2002 8:29 AM

I wrote a workbook with 2 worksheets, one for and the other for printout. Can I stop the user from printing the 'input' worksheet?

Posted by Sicinius on January 27, 2002 4:36 PM


Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim ws As Worksheet
For Each ws In ActiveWindow.SelectedSheets
If ws.Name = "Input" Then
MsgBox "You cannot print the Input sheet"
Cancel = True
Exit For
End If
Next
End Sub




Posted by KCY on January 27, 2002 7:16 PM

It works perfectly! Thank you.