Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Easy one - My string contains "

Hello all

Hopefully there is an easy fix to this infuriating problem. I need to
include a string in my code which contains the character " - eg:

msgbox("They call me Phil "The Power" Taylor")

The problem is that when VBA sees " it takes it as the end of the
string and I get a compile error.

Has anybody come across this before, and is there a solution?

Thanks

JT
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Easy one - My string contains "

MsgBox "They call me Phil ""The Power"" Taylor"

or preferable IMO

MsgBox "They call me Phil 'The Power' Taylor"

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"JT" wrote in message
...
Hello all

Hopefully there is an easy fix to this infuriating problem. I need to
include a string in my code which contains the character " - eg:

msgbox("They call me Phil "The Power" Taylor")

The problem is that when VBA sees " it takes it as the end of the
string and I get a compile error.

Has anybody come across this before, and is there a solution?

Thanks

JT



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Easy one - My string contains "

Thanks!

On Aug 29, 10:24*am, "Bob Phillips" wrote:
MsgBox "They call me Phil ""The Power"" Taylor"

or preferable IMO

MsgBox "They call me Phil 'The Power' Taylor"

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"JT" wrote in message

...



Hello all


Hopefully there is an easy fix to this infuriating problem. *I need to
include a string in my code which contains the character " - eg:


msgbox("They call me Phil "The Power" Taylor")


The problem is that when VBA sees " it takes it as the end of the
string and I get a compile error.


Has anybody come across this before, and is there a solution?


Thanks


JT- Hide quoted text -


- Show quoted text -


  #4   Report Post  
Posted to microsoft.public.excel.programming
Avi Avi is offline
external usenet poster
 
Posts: 29
Default Easy one - My string contains "

You can also use

MsgBox "They call me Phil " & Chr(34) & "The Power" & Chr(34) & "
Taylor"


On Aug 29, 3:16*pm, JT wrote:
Thanks!

On Aug 29, 10:24*am, "Bob Phillips" wrote:



MsgBox "They call me Phil ""The Power"" Taylor"


or preferable IMO


MsgBox "They call me Phil 'The Power' Taylor"


--
HTH


Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)


"JT" wrote in message


...


Hello all


Hopefully there is an easy fix to this infuriating problem. *I need to
include a string in my code which contains the character " - eg:


msgbox("They call me Phil "The Power" Taylor")


The problem is that when VBA sees " it takes it as the end of the
string and I get a compile error.


Has anybody come across this before, and is there a solution?


Thanks


JT- Hide quoted text -


- Show quoted text -- Hide quoted text -


- Show quoted text -


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
=SUBSTITUTE(C4,"~?#","") will this work to remove multiple string Raja Mahendiran S Excel Worksheet Functions 6 May 12th 10 09:10 PM
Converting "uppercase" string data to "lower case" in CSV file [email protected] Excel Discussion (Misc queries) 2 August 12th 08 08:36 PM
text string: "91E10" in csv file auto converts to: "9.10E+11" [email protected] Excel Discussion (Misc queries) 2 August 12th 08 03:13 PM
Easy Question "I think" Text with funtions in it??? Schwimms Excel Discussion (Misc queries) 7 January 31st 08 09:56 PM
How do I find ""Easy Sum" Not Auto Sum Damar Excel Discussion (Misc queries) 1 January 15th 07 12:19 PM


All times are GMT +1. The time now is 11:38 PM.

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"