View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Ken Johnson Ken Johnson is offline
external usenet poster
 
Posts: 1,073
Default Confirmation box

Hi Alex,

Dim Check As VbMsgBoxResult
Check = MsgBox("Are you sure you want this macro to run?", vbYesNo)
If Check = vbYes Then

could be at the start of your code, then straight after the last line
of your code (but before the End Sub line) the "End If" line.

This way, your code is only run if the user clicks the "Yes" button.
When the "No" button is clicked the code jumps to the "End If" then the
End Sub, so nothing happens.

Ken Johnson