![]() |
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 |
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 |
All times are GMT +1. The time now is 01:14 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com