Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Intriguing problem with the " quotation marks.
Hi Guys,
I'm trying to write a bit of simple code to make my cell (text string) values be surrounded by "Quotes" What I want is... Forename Surname to be enclosed by quotes, like this "Forename Surname" But, after trying myriad ways to get it with code I'm stuck. I've searched the newsgroup and found a few posts regarding double quotes, which I already knew. ActiveCell.Offset(0, 2).Value = """ & ActiveCell.Value & """ This displays in the cell as "" & ActiveCell.Value & "" But I need it to display as "Forename Surname" where Forename Surname is the contents of the active cell. I've tried all manner of combinations but no luck. I even thought of trying to insert a filler character (say X) and then have a bit more code remove the X's. Is there a simpler way? Thanks guys, Ron |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Intriguing problem with the " quotation marks.
You have triple quotes, it should only be double quotes -- davesexcel ------------------------------------------------------------------------ davesexcel's Profile: http://www.excelforum.com/member.php...o&userid=31708 View this thread: http://www.excelforum.com/showthread...hreadid=522143 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Intriguing problem with the " quotation marks.
Quote marks need to be doubled (then enclosed within a pair of quote
marks): ActiveCell.Offset(0, 2).Value = """" & ActiveCell.Value & """" Alternatively ActiveCell.Offset(0, 2).Value = Chr(34) & ActiveCell.Value & Chr(34) In article , Ron wrote: Hi Guys, I'm trying to write a bit of simple code to make my cell (text string) values be surrounded by "Quotes" What I want is... Forename Surname to be enclosed by quotes, like this "Forename Surname" But, after trying myriad ways to get it with code I'm stuck. I've searched the newsgroup and found a few posts regarding double quotes, which I already knew. ActiveCell.Offset(0, 2).Value = """ & ActiveCell.Value & """ This displays in the cell as "" & ActiveCell.Value & "" But I need it to display as "Forename Surname" where Forename Surname is the contents of the active cell. I've tried all manner of combinations but no luck. I even thought of trying to insert a filler character (say X) and then have a bit more code remove the X's. Is there a simpler way? Thanks guys, Ron |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Intriguing problem with the " quotation marks.
Hi Guys,
Many thanks for the swift reply. I am indeed sorted now. Ron |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Is there a difference between CTRL+D and CTRL+" (quotation marks) | Excel Discussion (Misc queries) | |||
Quotation Marks | Excel Discussion (Misc queries) | |||
quotation marks | Excel Worksheet Functions | |||
quotation marks | Excel Programming | |||
Using quotation marks | Excel Programming |