ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Event After Printing (https://www.excelbanter.com/excel-programming/277323-event-after-printing.html)

Tom Atkisson

Event After Printing
 
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.



Ron de Bruin

Event After Printing
 
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

--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Tom Atkisson" wrote in message ...
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.





Jim Cone[_3_]

Event After Printing
 
Hello Again,

Rob Bruce has a clever trick to accomplish this at:

http://www.rb-ad.dircon.co.uk/rob/ex...tips/index.htm

Regards,

Jim Cone
San Francisco, CA
XX
**********************

"Ron de Bruin" wrote in message ...
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
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl

"Tom Atkisson" wrote in message ...
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.



All times are GMT +1. The time now is 09:56 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com