Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Write " to a string

Hi

I have to write a single " (quotation mark) to a string but excel takes
it as an delimiter.
Anyone has a bright idea

Thanks in advance
Crister

  #2   Report Post  
Posted to microsoft.public.excel.programming
Ian Ian is offline
external usenet poster
 
Posts: 238
Default Write " to a string

MyString ="""

--
Ian
--
"thyrmo" wrote in message
oups.com...
Hi

I have to write a single " (quotation mark) to a string but excel takes
it as an delimiter.
Anyone has a bright idea

Thanks in advance
Crister



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 703
Default Write " to a string

I think you mean

MyString = """"

Any time you want to embed quote marks in a quoted string they need to be
doubled up

Debug.Print "This is a ""quoted string"""

"Ian" wrote:

MyString ="""

--
Ian
--
"thyrmo" wrote in message
oups.com...
Hi

I have to write a single " (quotation mark) to a string but excel takes
it as an delimiter.
Anyone has a bright idea

Thanks in advance
Crister




  #4   Report Post  
Posted to microsoft.public.excel.programming
Ian Ian is offline
external usenet poster
 
Posts: 238
Default Write " to a string

"Charlie" wrote in message
...
I think you mean

MyString = """"


No, thyrmo asked to write a single " into a cell, your solution writes ""
instead.

--
Ian
--


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Write " to a string


Hi Ian

Try running this routine and see what you get.

Sub test()
a = """"
MsgBox a
End Sub

Dominic

--
dominic
-----------------------------------------------------------------------
dominicb's Profile: http://www.excelforum.com/member.php...fo&userid=1893
View this thread: http://www.excelforum.com/showthread.php?threadid=46584



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Write " to a string

Either works to produce just a single "double quote" as the result.

from the immediate window:

? """"
"
? """
"

--
Regards,
Tom Ogilvy

"dominicb" wrote in
message ...

Hi Ian

Try running this routine and see what you get.

Sub test()
a = """"
MsgBox a
End Sub

DominicB


--
dominicb
------------------------------------------------------------------------
dominicb's Profile:

http://www.excelforum.com/member.php...o&userid=18932
View this thread: http://www.excelforum.com/showthread...hreadid=465843



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Write " to a string

Thanks for the quick reply
and as normal the simplest soultions are the best

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Write " to a string


Good morning Thyrmo

The reference number for the " is 34. Therefor the following line
would place a single quote in a string contained in the variable a :

a=Chr(34)

HTH

DominicB


--
dominicb
------------------------------------------------------------------------
dominicb's Profile: http://www.excelforum.com/member.php...o&userid=18932
View this thread: http://www.excelforum.com/showthread...hreadid=465843

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 write formula for countif (range,"<2" &"3") Vinod Tripathi Excel Discussion (Misc queries) 1 May 1st 09 07:27 AM
How do I write an excel formula with a text answer ("yes" or "no") pat Excel Discussion (Misc queries) 1 September 9th 08 03:41 PM
is it possitle i write"1"and "one" will show in next coloumn. srksiddiqui Excel Discussion (Misc queries) 1 June 9th 08 02:37 PM
Using "Cells" to write "Range("A:A,H:H").Select" Trip Ives[_2_] Excel Programming 3 June 5th 04 03:13 PM
How can i write a vba code to get string or integer "C15" from $c$15? d Excel Programming 2 August 29th 03 06:11 PM


All times are GMT +1. The time now is 10:31 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"