run macro based on Yes/No

  • Thread starter Thread starter Sheila
  • Start date Start date
S

Sheila

I have some small macro buttons for printing. There are 12 of them
and they are many pages so I wish to add into the macro (at the start)
the oprion for the user to opt out of running the print macro using a
Yes/No button. Can someone help as to how I can word the macro so
that this will work?

TIA
sheila
 
Is this what you want?

'----
Sub test()
Dim goOn As Integer
goOn = MsgBox(prompt:="Do you want to continue?", _
Buttons:=vbOKCancel, Title:="Start printing?")
If goOn = vbCancel Then Exit Sub

MsgBox "Continue"
End Sub
'----

HTH
Anders Silvén
 
Looks good, thanks for that.

sheila


Is this what you want?

'----
Sub test()
Dim goOn As Integer
goOn = MsgBox(prompt:="Do you want to continue?", _
Buttons:=vbOKCancel, Title:="Start printing?")
If goOn = vbCancel Then Exit Sub

MsgBox "Continue"
End Sub
'----

HTH
Anders Silvén
 
Back
Top