Trapping Print event in excel vba

J

Jim Rech

You can return the sheets selected like this:

Sub ShowSelectedSheets()
Dim Sh As Worksheet
For Each Sh In ActiveWindow.SelectedSheets
MsgBox Sh.Name
Next
End Sub

but if the user chose to print 'Entire workbook' instead of the default
'Active sheet(s)' I'm not sure you can detect that.

--
Jim
| Hi,
|
| I'm trapping the App_workbookbefore Print Event which is working
| wonderfully!
|
| See http://www.cpearson.com/excel/AppEvent.aspx
|
| But The Question I've got is it possible to return what sheet, if only
| one sheet is printed or sheets if multiple sheets are printed.
|
 
J

JJ

Thanks for the reply,

Getting the current sheet etc is nice and simple like you say, Its the
what ifs thats the problem.

Again the user could select all workbook, or a number of sheets.

Anyone know if getting the sheets printed is possible, Or a after the
print options screen comes up Event?
 

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