View Full Version : MSG Box In Excel VBA


technician
01-20-2007, 02:10 AM
Hiya All

Not sure what i am doing wrong here

here is the simple code

MsgBox("Are you sure that you want to delete all data?", vbYesNo, "Warning")

I keep getting syntax errors witht this!


what am i doing wrong??


normal msgbox("hello") works

Many thanks for looking
Paul

Brianwarnock
01-20-2007, 02:54 AM
From Help

Note To specify more than the first named argument, you must use MsgBox in an expression.

I suggest you read Help.

Brian

shades
01-20-2007, 07:16 AM
It appears that you are trying to use Userform setup for MsgBox. Two different animals. MsgBox will not allow you to take the action you want, it just informs you of whatever is the argument. If you create a Userform, then you can take action with the dialog box that appears.