#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Printing

I have a workbook with about 15 different worksheets. The main sheets
are named week 1 through week 6. I also have a sheet named recap. Here
is the question. When a user goes to print say Week 2 I would like a
msgbox to appear and ask "do you want to print the recap sheet also?"
This is where I am stumped. My thinking is that I should send sub
procdure to call from before print. But then how do I get it to print
the recap. I AM SO CONFUSED!!!!!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 73
Default Printing

Pete, try this

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Msg = "Do you want to print the recap sheet also ?"
Title = "Print Recap Sheet ?"
Response = MsgBox(Msg, vbYesNo + vbQuestion, Title)

If Response = vbNo Then
Exit Sub ' Quit the macro
End If
Application.ScreenUpdating = False
Application.EnableEvents = False
Sheets("recap").PrintOut Copies:=1
Application.EnableEvents = True
Application.ScreenUpdating = True
End Sub

--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 97 & 2000
** remove news from my email address to reply by email **

"Pete" wrote in message
om...
I have a workbook with about 15 different worksheets. The main sheets
are named week 1 through week 6. I also have a sheet named recap. Here
is the question. When a user goes to print say Week 2 I would like a
msgbox to appear and ask "do you want to print the recap sheet also?"
This is where I am stumped. My thinking is that I should send sub
procdure to call from before print. But then how do I get it to print
the recap. I AM SO CONFUSED!!!!!



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 88
Default Printing

Paul, thanks, this is what I was looking for. Could not figure it out
myself.


"Paul B" wrote in news:O6jtX5mvDHA.2508
@TK2MSFTNGP12.phx.gbl:

Pete, try this

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Msg = "Do you want to print the recap sheet also ?"
Title = "Print Recap Sheet ?"
Response = MsgBox(Msg, vbYesNo + vbQuestion, Title)

If Response = vbNo Then
Exit Sub ' Quit the macro
End If
Application.ScreenUpdating = False
Application.EnableEvents = False
Sheets("recap").PrintOut Copies:=1
Application.EnableEvents = True
Application.ScreenUpdating = True
End Sub


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 135
Default Printing

Pete, Your welcome

--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2000 & 97
** remove news from my email address to reply by email **
"Pete" wrote in message
...
Paul, thanks, this is what I was looking for. Could not figure it out
myself.


"Paul B" wrote in news:O6jtX5mvDHA.2508
@TK2MSFTNGP12.phx.gbl:

Pete, try this

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Msg = "Do you want to print the recap sheet also ?"
Title = "Print Recap Sheet ?"
Response = MsgBox(Msg, vbYesNo + vbQuestion, Title)

If Response = vbNo Then
Exit Sub ' Quit the macro
End If
Application.ScreenUpdating = False
Application.EnableEvents = False
Sheets("recap").PrintOut Copies:=1
Application.EnableEvents = True
Application.ScreenUpdating = True
End Sub




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
Excel Printing --Borders are not printing on the same page as data Stup88 Excel Discussion (Misc queries) 1 August 7th 07 09:34 AM
Printing a heading on each new page when printing Brian Excel Discussion (Misc queries) 3 November 15th 06 05:22 PM
printing sammy Excel Discussion (Misc queries) 2 April 12th 05 08:32 PM
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 07:07 AM.

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

About Us

"It's about Microsoft Excel"