Hi all,

Im a beginner in VBA. I am using Excel 2011 for Mac. Currently, in my attempt to master VBA, im reading this book called "Microsoft Excel VBA Programming for Dummies".

Apparently, in the book, almost all the codes given as example, when I input it in my VB editor, it won't work. For example, when I input the below code, what was shown to me it shows syntax error.

Sub GuessName()
Msg = “Is your name “ & Application.UserName & “?”
Ans = MsgBox(Msg, vbYesNo)
If Ans = vbNo Then MsgBox “Oh, never mind.”
If Ans = vbYes Then MsgBox “I must be psychic!”
End Sub

And when I run another code (shown below), it initially highlight the all and an error box pops up saying "Compile error: Expected: end of statement". After I clicked ok and try running again, it shows up syntax error again.

Sub ShowMessage()
MsgBox “That’s all folks!”
End Sub

I am really getting crazy over all these errors pop out. Can anyone enlighten me whats wrong? It can't possibly be all the given examples in the book are wrong right?

PS: the author mentioned that this book I am using is for Excel 2007 or Excel 2010. Could it be that Excel 2011 VBA is of a different version or something?

Thank you all!