Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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



wrote in message
oups.com...
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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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



wrote in message
oups.com...
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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to give a string of data into different columns Elton Law[_2_] Excel Worksheet Functions 8 June 4th 10 02:24 PM
search a string as substring and give adjacent values Eddy Stan Excel Worksheet Functions 1 June 23rd 08 03:05 PM
How to look for a sequence of numbers in a string? brett Excel Discussion (Misc queries) 2 October 27th 05 01:44 AM
Search for a string sequence in a cell CLS Excel Programming 3 May 6th 05 09:31 PM
Escape for special characters in string Jag Man Excel Programming 2 January 2nd 04 03:56 AM


All times are GMT +1. The time now is 08:08 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"