EXCEL macro with a msgbox

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
 
F

Felipe

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
 
P

PCOR

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
 

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