+ Reply to Thread
Results 1 to 3 of 3

How to give escape sequence in Excel string literals...

  1. #1

    How to give escape sequence in Excel string literals...

    Hi,

    I found that Excel does not allow C-lang style escape sequence. E.g. \"
    like escape is not allowed. I tried with other tinkering as well but
    did not work. Could not found direct pointer from Excel help.

    Can somebody help, how to put escape sequences in Excel functions?

    Thanks for your time.

    - KA


  2. #2
    Tom Ogilvy
    Guest

    Re: How to give escape sequence in Excel string literals...

    you can use chr(34) and concatenate it. (or produce any character using chr)

    In line for double quotes, you double the double quote

    sStr = "this is ""Jim's"" last chance"


    from the immediate window:
    sStr = "this is ""Jim's"" last chance"
    ? sStr
    this is "Jim's" last chance


    \n would be the constant vbNewLine

    "this is placed" & vbNewLine & "on two lines"

    but as you see, you need to use concatenation.

    ? "this is placed" & vbNewLine & "on two lines"
    this is placed
    on two lines

    --
    Regards,
    Tom Ogilvy



    <[email protected]> wrote in message
    news:[email protected]...
    > Hi,
    >
    > I found that Excel does not allow C-lang style escape sequence. E.g. \"
    > like escape is not allowed. I tried with other tinkering as well but
    > did not work. Could not found direct pointer from Excel help.
    >
    > Can somebody help, how to put escape sequences in Excel functions?
    >
    > Thanks for your time.
    >
    > - KA
    >




  3. #3

    Re: How to give escape sequence in Excel string literals...

    Thanks Tom, it worked.
    Thanks for your time and solution.
    Regards.
    - Kedar Agarkar

    Tom Ogilvy wrote:
    > you can use chr(34) and concatenate it. (or produce any character using chr)
    >
    > In line for double quotes, you double the double quote
    >
    > sStr = "this is ""Jim's"" last chance"
    >
    >
    > from the immediate window:
    > sStr = "this is ""Jim's"" last chance"
    > ? sStr
    > this is "Jim's" last chance
    >
    >
    > \n would be the constant vbNewLine
    >
    > "this is placed" & vbNewLine & "on two lines"
    >
    > but as you see, you need to use concatenation.
    >
    > ? "this is placed" & vbNewLine & "on two lines"
    > this is placed
    > on two lines
    >
    > --
    > Regards,
    > Tom Ogilvy
    >
    >
    >
    > <[email protected]> wrote in message
    > news:[email protected]...
    > > Hi,
    > >
    > > I found that Excel does not allow C-lang style escape sequence. E.g. \"
    > > like escape is not allowed. I tried with other tinkering as well but
    > > did not work. Could not found direct pointer from Excel help.
    > >
    > > Can somebody help, how to put escape sequences in Excel functions?
    > >
    > > Thanks for your time.
    > >
    > > - KA
    > >



+ 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