VBA Code for pop confirmation box

L

Leigh Douglass

Hi

I have a macro assigned to a button on my spreadsheet, but I would like to
have a confirmation box pop up asking the user if they are sure they want to
proceed. Obviously i need the pop up to proceed with running the macro if
they choose yes and to stop the macro if they choose no. Thanks for any
advice.
 
M

Mike

This might work
If MsgBox("Click yes to proceed or no to cancel", vbQuestion + vbYesNo) <>
vbYes Then
MsgBox ("you clicked no")
'do nothing
Else
MsgBox ("you clicked yes")
'do something
End If
 

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

Top