Workbook_BeforePrint

S

Squid

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
 
D

Don Guillett

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
 
B

Bob Phillips

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)
 
Top