![]() |
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 |
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 |
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 - |
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 - |
All times are GMT +1. The time now is 12:10 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com