+ Reply to Thread
Results 1 to 5 of 5

VBA - Formula generating "Compile error/ Syntax Error"

  1. #1
    Registered User
    Join Date
    08-19-2009
    Location
    Winnipeg, Manitoba, Canada
    MS-Off Ver
    Excel 2003
    Posts
    90

    VBA - Formula generating "Compile error/ Syntax Error"

    Hello,

    I'm trying to write a macro that will insert a excel formula into a specific cell. When I try to run the macro I receive a compile/ syntax error. I don't understand why as the formula works in excel....

    Here is the code (formula only)

    Please Login or Register  to view this content.

    Here is the Full code

    Please Login or Register  to view this content.
    Thank you in advance.....
    Last edited by arvin; 12-03-2009 at 03:36 PM. Reason: didn't see the drop down for entering [SOLVED]

  2. #2
    Forum Expert
    Join Date
    12-29-2004
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    2,208

    Re: VBA - Formula generating "Compile error/ Syntax Error"

    Hi arvin,

    Whenever you are creating a string in VBA, if you have quotes within the string, you need to double them up:

    Please Login or Register  to view this content.
    HTH,
    Jason

  3. #3
    Registered User
    Join Date
    08-19-2009
    Location
    Winnipeg, Manitoba, Canada
    MS-Off Ver
    Excel 2003
    Posts
    90

    Re: VBA - Formula generating "Compile error/ Syntax Error"

    Wow.. ...Thank you very much for that tip ... I was not aware of that. I tried the macro and it works now ...

    Thank you again!

  4. #4
    Forum Expert
    Join Date
    12-29-2004
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    2,208

    Re: VBA - Formula generating "Compile error/ Syntax Error"

    Great to hear! Please mark the thread as solved.

  5. #5
    Registered User
    Join Date
    08-19-2009
    Location
    Winnipeg, Manitoba, Canada
    MS-Off Ver
    Excel 2003
    Posts
    90

    [SOLVED] VBA - Formula generating "Compile error/ Syntax Error"

    Marking thread as "solved"

    Thank for you all your help

+ 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