Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello, advice appreciated please.
I've got this line of VBA: sScreenContents = Application.Substitute(sScreenContents, """", "\""") The idea is to find any quotes in a string and escape them with a backslash before outputting. The problem is that the output has \"" rather than just the \" I was expecting, if I change the code to: sScreenContents = Application.Substitute(sScreenContents, """", "\"") the line is highlighted in red. Any ideas of a way round this, or am I doing something wrong? Thanks. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
sScreenContents = Application.Substitute(sScreenContents, """", "\")
-- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "David" wrote in message ups.com... Hello, advice appreciated please. I've got this line of VBA: sScreenContents = Application.Substitute(sScreenContents, """", "\""") The idea is to find any quotes in a string and escape them with a backslash before outputting. The problem is that the output has \"" rather than just the \" I was expecting, if I change the code to: sScreenContents = Application.Substitute(sScreenContents, """", "\"") the line is highlighted in red. Any ideas of a way round this, or am I doing something wrong? Thanks. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try using the ascii value as per this:-
sScreenContents = Application.Substitute(sScreenContents, Chr(34), Chr(92)) I tested it and it works. Regards, OssieMac "David" wrote: Hello, advice appreciated please. I've got this line of VBA: sScreenContents = Application.Substitute(sScreenContents, """", "\""") The idea is to find any quotes in a string and escape them with a backslash before outputting. The problem is that the output has \"" rather than just the \" I was expecting, if I change the code to: sScreenContents = Application.Substitute(sScreenContents, """", "\"") the line is highlighted in red. Any ideas of a way round this, or am I doing something wrong? Thanks. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
MSN stock quotes - Error message "problem displaying attributes" | Excel Discussion (Misc queries) | |||
change straight quotes to curly quotes | Excel Discussion (Misc queries) | |||
Problem: Copying a cell that contains line breaks adds extra quotes | Excel Discussion (Misc queries) | |||
How do i get historical stock quotes using MSN Money Stock Quotes | Excel Discussion (Misc queries) | |||
Slight problem - routine to add quotes to a column | Excel Programming |