+ Reply to Thread
Results 1 to 4 of 4

Quotation marks in a function causing an error?

Hybrid View

Reportreporter Quotation marks in a function... 10-28-2013, 08:53 AM
stnkynts Re: Quotation marks in a... 10-28-2013, 08:57 AM
martindwilson Re: Quotation marks in a... 10-28-2013, 08:58 AM
Reportreporter Re: Quotation marks in a... 10-28-2013, 09:03 AM
  1. #1
    Registered User
    Join Date
    10-28-2013
    Location
    Queensland, Australia
    MS-Off Ver
    Excel 2010
    Posts
    2

    Quotation marks in a function causing an error?

    I have a macro that contains the following line:

    ActiveCell.FormulaR1C1 = "=TEXT(RC[-1],"DDDD")"

    but it seems that the debugger is counting the second quotation mark (just before the DDDD) as the end of the TEXT function, and it's giving me an "Expected: End of Statement" error. How do I get around this?

    Thanks

  2. #2
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Quotation marks in a function causing an error?

    You need one more set of quotes in this situation:

    ActiveCell.FormulaR1C1 = "=TEXT(RC[-1],""DDDD"")"

  3. #3
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Quotation marks in a function causing an error?

    ActiveCell.FormulaR1C1 = "=TEXT(RC[-1],""DDDD"")"
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  4. #4
    Registered User
    Join Date
    10-28-2013
    Location
    Queensland, Australia
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Quotation marks in a function causing an error?

    That's something I would never had though of.

    Thanks for your help!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Quotation marks and Error '54'
    By auanika in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-05-2010, 05:09 AM
  2. Quotation marks causing error
    By swallis in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-26-2010, 07:31 AM
  3. InStr Function using Quotation Marks
    By CrazyFileMaker in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-01-2010, 03:15 PM
  4. Quotation marks messing up function
    By Leah in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-15-2008, 03:44 PM
  5. [SOLVED] VBA vlookup error depending on text string & quotation marks
    By xlcharlie in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-19-2006, 10:05 AM

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