I've seen a lot of ways to do this but how I'm starting with vba I'd like to know all the ways to do this for after I can choose the way I liked the most.
I saw this example of code in Microsoft Oficcial page:
Dim Msg, Style, Title, Help, Ctxt, Response, MyString
Msg = "Do you want to continue ?" ' Define message.
Style = vbYesNo + vbCritical + vbDefaultButton2 ' Define buttons.
Title = "MsgBox Demonstration" ' Define title.
Help = "DEMO.HLP" ' Define Help file.
Ctxt = 1000 ' Define topic context.
' Display message.
Response = MsgBox(Msg, Style, Title, Help, Ctxt)
I wanted to do the same but without variables, i mean, this:
MsgBox("Do you want to continue?", vbYesNo + vbCritical + vbDefaultButton2,"MsgBox Demostration ")
but this returns me an error, I think the example is doing exactly the same than me but without variables so I dont know why this doesn't work.
I saw another people doing this:
MsgBox("Do you want to continue?",msgboxstyle.vbYesNo,"tittle")
But this doesn't work for me either.