Thread: Message Box
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
Ron (Bismark) Ron (Bismark) is offline
external usenet poster
 
Posts: 9
Default Message Box

Thank you your info has helped me and saved me heaps of time. I had been
trying to achieve this for last two days. Very much appreciated.

"JE McGimpsey" wrote:

One way:

Dim nResult As Long
nResult = Msgbox(Prompt:="Continue?", Buttons:=vbYesNo)
If nResult = vbYes Then
'Your code here
End If

Or, if you don't mind having multiple exit points to your macro:

Dim nResult As Long
nResult = Msgbox(Prompt:="Continue?", Buttons:=vbYesNo)
If nResult = vbNo then Exit Sub
'Your code here

In article ,
Ron (Bismark) wrote:

I am trying to add a message box into a macro that will provide Yes / No
option. "Yes " to continue macro and "No" to end macro.