Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello,
Could some one please help me with the following? In column B of my workbook, I have a list of text data (5500 lines) - an example of this is given below. I wish to prefix each data value with a single quotation mark as shown below, but I do not know how to do this. Cell B2: ABC123-UYT Cell B3: 001HF-367 Cell B4: 00001-KML-8741 I need to change the above to this: Cell B2: 'ABC123-UYT Cell B3: '001HF-367 Cell B4: '00001-KML-8741 Any help would be greatly appreciated. Thanks, Chris. *** Sent via Developersdex http://www.developersdex.com *** |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Select the cells you want to convert and run:
Sub dont_quote_me() apos = Chr(39) For Each r In Selection r.Value = apos & apos & r.Value Next End Sub Note that you need two single quotes, not just one. -- Gary''s Student - gsnu2007d "Chris Hankin" wrote: Hello, Could some one please help me with the following? In column B of my workbook, I have a list of text data (5500 lines) - an example of this is given below. I wish to prefix each data value with a single quotation mark as shown below, but I do not know how to do this. Cell B2: ABC123-UYT Cell B3: 001HF-367 Cell B4: 00001-KML-8741 I need to change the above to this: Cell B2: 'ABC123-UYT Cell B3: '001HF-367 Cell B4: '00001-KML-8741 Any help would be greatly appreciated. Thanks, Chris. *** Sent via Developersdex http://www.developersdex.com *** |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks Gary for your reply - just a question please - why do I need
quote: Note that you need two single quotes, not just one. Unquote.? A single quotation mark seems to work fine - so will your code work OK to produce a single quotation mark? Thanks, Chris. *** Sent via Developersdex http://www.developersdex.com *** |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If you select a cell and manually type two single quotes and the text
APPLES the formula bar will show both quotes, but the cell only one. Excel treats the first single quote as a special text marker and not as part of the string. -- Gary''s Student - gsnu2007d "Chris Hankin" wrote: Thanks Gary for your reply - just a question please - why do I need quote: Note that you need two single quotes, not just one. Unquote.? A single quotation mark seems to work fine - so will your code work OK to produce a single quotation mark? Thanks, Chris. *** Sent via Developersdex http://www.developersdex.com *** |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks again Gary - much appreciated.
Cheers, Chris. *** Sent via Developersdex http://www.developersdex.com *** |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Use two single quotations...
Mark Ivey "Chris Hankin" wrote in message ... Hello, Could some one please help me with the following? In column B of my workbook, I have a list of text data (5500 lines) - an example of this is given below. I wish to prefix each data value with a single quotation mark as shown below, but I do not know how to do this. Cell B2: ABC123-UYT Cell B3: 001HF-367 Cell B4: 00001-KML-8741 I need to change the above to this: Cell B2: 'ABC123-UYT Cell B3: '001HF-367 Cell B4: '00001-KML-8741 Any help would be greatly appreciated. Thanks, Chris. *** Sent via Developersdex http://www.developersdex.com *** |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Single quotation mark in Excel not showing up | Excel Discussion (Misc queries) | |||
Single Quotation mark in CSV | Excel Discussion (Misc queries) | |||
Single Quotation mark in CSV | Excel Discussion (Misc queries) | |||
what is single quotation mark left side of cell for | Excel Discussion (Misc queries) | |||
Single or Double Quotation Mark and it comes up twice | Setting up and Configuration of Excel |