Microsoft Office Tutorials and References
In Depth Information
ActiveSheet.PrintOut ‘demo with PrintPreview
‘Restore the General format to the confidential range
‘so the cells will be able to show their contents
‘after the print job.
Range(“B5:D12”).NumberFormat = “General”
‘Enable events again, now that the print job has been executed.
Application.EnableEvents = True
Press Alt+Q to return to the worksheet. Test the code by printing Sheet3, noting that the
printout will show an empty range of cells, representing the range of confidential data that
did not get printed.