+ Reply to Thread
Results 1 to 4 of 4

Intriguing problem with the " quotation marks.

  1. #1
    Ron
    Guest

    Intriguing problem with the " quotation marks.

    Hi Guys,

    I'm trying to write a bit of simple code to make my cell (text string)
    values be surrounded by "Quotes"

    What I want is... Forename Surname to be enclosed by quotes, like this
    "Forename Surname"

    But, after trying myriad ways to get it with code I'm stuck. I've searched
    the newsgroup and found a few posts regarding double quotes, which I
    already knew.

    ActiveCell.Offset(0, 2).Value = """ & ActiveCell.Value & """

    This displays in the cell as "" & ActiveCell.Value & ""

    But I need it to display as "Forename Surname" where Forename Surname is
    the contents of the active cell.

    I've tried all manner of combinations but no luck. I even thought of
    trying to insert a filler character (say X) and then have a bit more code
    remove the X's.

    Is there a simpler way?

    Thanks guys,

    Ron

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,486
    You have triple quotes, it should only be quadriple quotes
    Last edited by davesexcel; 03-14-2006 at 10:36 AM.

  3. #3
    JE McGimpsey
    Guest

    Re: Intriguing problem with the " quotation marks.

    Quote marks need to be doubled (then enclosed within a pair of quote
    marks):

    ActiveCell.Offset(0, 2).Value = """" & ActiveCell.Value & """"

    Alternatively

    ActiveCell.Offset(0, 2).Value = Chr(34) & ActiveCell.Value & Chr(34)


    In article <[email protected]>,
    Ron <[email protected]> wrote:

    > Hi Guys,
    >
    > I'm trying to write a bit of simple code to make my cell (text string)
    > values be surrounded by "Quotes"
    >
    > What I want is... Forename Surname to be enclosed by quotes, like this
    > "Forename Surname"
    >
    > But, after trying myriad ways to get it with code I'm stuck. I've searched
    > the newsgroup and found a few posts regarding double quotes, which I
    > already knew.
    >
    > ActiveCell.Offset(0, 2).Value = """ & ActiveCell.Value & """
    >
    > This displays in the cell as "" & ActiveCell.Value & ""
    >
    > But I need it to display as "Forename Surname" where Forename Surname is
    > the contents of the active cell.
    >
    > I've tried all manner of combinations but no luck. I even thought of
    > trying to insert a filler character (say X) and then have a bit more code
    > remove the X's.
    >
    > Is there a simpler way?
    >
    > Thanks guys,
    >
    > Ron


  4. #4
    Ron
    Guest

    Re: Intriguing problem with the " quotation marks.

    Hi Guys,

    Many thanks for the swift reply.

    I am indeed sorted now.


    Ron

+ 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