EXCEL macro with a msgbox

  • Thread starter Thread starter PCOR
  • Start date Start date
P

PCOR

I have written a number of macros. Now I would like to add a msgbox just as
the macro starts stating what that particular macro does and give an option
to either proceed with the macro of decline to run it
Can/will someone help me with a little code? Please and thanks
 
Dim intX As Integer
Dim Style

Sub Macro1()
Style = vbYesNo
intX = MsgBox("Your message here", Style)
If intX = vbYes Then
'Your macro code here
End If
End Sub

Regards,
Felipe
 
Works GREAT...Many Thanks

Felipe said:
Dim intX As Integer
Dim Style

Sub Macro1()
Style = vbYesNo
intX = MsgBox("Your message here", Style)
If intX = vbYes Then
'Your macro code here
End If
End Sub

Regards,
Felipe
 
Back
Top