VBA Code for pop confirmation box

  • Thread starter Thread starter Leigh Douglass
  • Start date Start date
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.
 
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
 
Back
Top