+ Reply to Thread
Results 1 to 2 of 2

Excel Mac 2011 VBA

  1. #1
    Registered User
    Join Date
    03-31-2012
    Location
    Singapore
    MS-Off Ver
    Excel Mac 2011
    Posts
    10

    Excel Mac 2011 VBA

    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!

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Excel Mac 2011 VBA

    e1504,

    Please take a moment to read the forum rules and then amend your thread title to something descriptive of your problem. Once you have done this please send me a PM and I will remove this request.

    To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    Also,

    Please put code tags for your code in post 1.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1