After Print event

G

Guest

I used BeforePrint event to activate multiple sheets in a
document, so every time someone tries to print, all pages
are included.
After the print job is done, I want Sheet1 to be the only
active sheet. In other words, I want the activesheets to
go from multiple sheets to one sheet, but since there is
no AfterPrint event, I am not sure how to handle this.

Thanks.
 
D

Dave Peterson

You can use application.ontime to call another routine after a little bit.

Option Explicit
Private Sub Workbook_BeforePrint(Cancel As Boolean)
'your print routine
Worksheets.Select '??

Application.OnTime Now + TimeSerial(0, 0, 3), "AfterPrint"
End Sub

And in a general module:
Option Explicit
Sub AfterPrint()
Worksheets("Sheet1").Select
End Sub

Chip Pearson explains ontime at:
http://www.cpearson.com/excel/ontime.htm
 
B

Bob Phillips

Have you tried to simply activate one sheet after the printout statement in
that event?

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
T

Tom Ogilvy

Seems a little flaky.

Why not just
disable events
print the sheets
cancel the print triggering the beforeprint
' select a single sheet if selection was used to print
enable events.
 
D

Dave Peterson

That's an alternative, too <bg>.



Tom said:
Seems a little flaky.

Why not just
disable events
print the sheets
cancel the print triggering the beforeprint
' select a single sheet if selection was used to print
enable events.
 

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