ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Workbook_BeforePrint (https://www.excelbanter.com/excel-programming/297944-workbook_beforeprint.html)

Squid[_2_]

Workbook_BeforePrint
 
I want the test the result of a msgbox in the
Workbook_BeforePrint event. If the users clicks Yes,
print the spreadsheet, if the user clicks No, do not print.

I forget how to accomplish this.

TIA

Mike

Don Guillett[_4_]

Workbook_BeforePrint
 
Here is the basic idea. Adapt within the before print macro of the
ThisWorkbook module

Sub askem()
ans = InputBox("Do you want to print? yes or no", vbYesNo)
If ans = "yes" Then
MsgBox "go"
Else
MsgBox "nogo"
End If
End Sub

--
Don Guillett
SalesAid Software

"Squid" wrote in message
...
I want the test the result of a msgbox in the
Workbook_BeforePrint event. If the users clicks Yes,
print the spreadsheet, if the user clicks No, do not print.

I forget how to accomplish this.

TIA

Mike




Bob Phillips[_6_]

Workbook_BeforePrint
 

ans = MsgBox(msg, vbYesNo, title)
If ans = vbYes Then
' do it
End If


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Squid" wrote in message
...
I want the test the result of a msgbox in the
Workbook_BeforePrint event. If the users clicks Yes,
print the spreadsheet, if the user clicks No, do not print.

I forget how to accomplish this.

TIA

Mike





All times are GMT +1. The time now is 06:59 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com