+ Reply to Thread
Results 1 to 4 of 4

How to concatenate quotation marks and a string variable?

  1. #1
    Registered User
    Join Date
    08-06-2013
    Location
    the boonies
    MS-Off Ver
    Excel 2007
    Posts
    46

    How to concatenate quotation marks and a string variable?

    This one should be easy.

    In VBA, what would be the proper syntax that would concatenate a quotation mark, a variable, and another quotation mark?

    In my line of code:
    Please Login or Register  to view this content.
    returns E67.

    However, I want strFirstColorBarCell to evaluate as "E67", so I'd like to pass quotation marks before and after the part of the code that generates E67.

    Thanks!
    g

  2. #2
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: How to concatenate quotation marks and a string variable?

    try:
    Please Login or Register  to view this content.
    If I understand what you want.
    Thanks,
    Solus


    Please remember the following:

    1. Use [code] code tags [/code]. It keeps posts clean, easy-to-read, and maintains VBA formatting.
    Highlight the code in your post and press the # button in the toolbar.
    2. Show appreciation to those who have helped you by clicking below their posts.
    3. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.

    "Slow is smooth, smooth is fast."

  3. #3
    Registered User
    Join Date
    08-06-2013
    Location
    the boonies
    MS-Off Ver
    Excel 2007
    Posts
    46

    Re: How to concatenate quotation marks and a string variable?

    Thanks, Solus. That did the trick.

    The quadruple quotation mark was the syntax that I needed.

    (I had tried to "quote-the-quotes" with three quotation marks in a row, but that is not the way to do it -- four quotes it is.)

  4. #4
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: How to concatenate quotation marks and a string variable?

    I think its one of those weird VBA constants. Four quotes is read as 1. I'm sure they have perfectly good reason for making it that way but I don't know what it is.

+ 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. CONCATENATE - Auto Quotation Marks Appears
    By Adys747 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-10-2013, 04:46 PM
  2. [SOLVED] CONCATENATE text that includes quotation marks
    By spoonpilot in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-30-2012, 04:13 PM
  3. Quotation marks in concatenate command.
    By plitv001 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-15-2008, 08:15 PM
  4. How do I concatenate text that actually contains quotation marks?
    By Excel Distress in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-15-2005, 10:06 AM
  5. Quotation marks in String
    By Nathan in forum Excel General
    Replies: 2
    Last Post: 03-08-2005, 06:06 AM

Tags for this Thread

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