Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default 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.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default 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.




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default 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.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2003 printing problem--printing 1 document on 2 pages Bons Excel Discussion (Misc queries) 0 December 24th 09 04:15 PM
event vba irosh Excel Worksheet Functions 4 November 11th 08 09:25 AM
event marker68 Excel Discussion (Misc queries) 1 April 4th 08 02:38 PM
Excel Printing --Borders are not printing on the same page as data Stup88 Excel Discussion (Misc queries) 1 August 7th 07 09:34 AM
Enable Double sided printing contiuously when printing multiple s. Lee Excel Discussion (Misc queries) 1 November 27th 04 01:58 AM


All times are GMT +1. The time now is 11:48 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"