Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default 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
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
Is there a difference between CTRL+D and CTRL+" (quotation marks) AKMMS Excel Discussion (Misc queries) 2 March 22nd 10 07:43 PM
Quotation Marks 9pluck9 Excel Discussion (Misc queries) 2 May 2nd 07 04:40 PM
quotation marks JohnF Excel Worksheet Functions 7 February 5th 06 09:33 PM
quotation marks Hippy Excel Programming 2 November 4th 05 11:05 PM
Using quotation marks Mike Collard Excel Programming 4 July 20th 04 08:09 PM


All times are GMT +1. The time now is 05:28 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"