Event After Printing

  • Thread starter Thread starter Tom Atkisson
  • Start date Start date
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.
 
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
 
Back
Top