Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Use code to cancel printing

We use spreadsheets with week ending dates, but many users
forget to change the date. This leads to a lot of
reprinting. I would like to use a message box with
vbYesNo, Yes would allow the spreadsheet to print, No
would cancel the print.
Any ideas?
Thanks,
JT

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 320
Default Use code to cancel printing

Put code in the workbook_beforeprint event -- you can do something like:
Private Sub Workbook_BeforePrint(Cancel as Boolean)
if Msgbox(Did you change the date?",vbyesno+vbquestion)=vbno then
msgbox "Please do so, then try again.",vbexclamation
cancel=true
end if
End Sub

Bob Umlas
Excel MVP

"Jim " wrote
in message ...
We use spreadsheets with week ending dates, but many users
forget to change the date. This leads to a lot of
reprinting. I would like to use a message box with
vbYesNo, Yes would allow the spreadsheet to print, No
would cancel the print.
Any ideas?
Thanks,
JT



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
Cancel printing a worksheet Johnny W. Excel Worksheet Functions 0 March 4th 10 08:13 PM
Cancel printing a worksheet Johnny W. Excel Worksheet Functions 1 March 4th 10 04:30 PM
Workbook_BeforeClose(Cancel As Boolean) - Cancel won't work gpmichal Setting up and Configuration of Excel 1 May 12th 09 02:33 AM
Printing code Jase Excel Discussion (Misc queries) 2 September 15th 08 07:49 PM
Exit Code Upon Cancel On Type 8 Input Box FARAZ QURESHI Excel Discussion (Misc queries) 2 March 31st 08 09:22 AM


All times are GMT +1. The time now is 08:10 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"