Workbook_BeforePrint

  • Thread starter Thread starter Squid
  • Start date Start date
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
 
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
 
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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top