Event After Printing

T

Tom Atkisson

I have a Workbook that uses the Workbook_BeforePrint sub in ThisWorkbook to
hide some columns. Is there a way to unhide those columns after printing?
Doesn't seem to be a AfterPrint procedure.

Thanks in advance.
 
R

Ron de Bruin

Use this Tom

Private Sub Workbook_BeforePrint(Cancel As Boolean)
On Error GoTo ErrorHandler
Cancel = True
Application.EnableEvents = False
With Sheet1 'or whichever sheet is to be printed
.Rows("8:12").EntireRow.Hidden = True
.PrintOut
.Rows("8:12").EntireRow.Hidden = False
End With
ErrorHandler:
Application.EnableEvents = True
End Sub
 

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

Top