![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Apr 2002
Posts: 9
|
I sometimes get a unique character in cells that looks like a single quote. It isn't something I've typed, it just shows up. I've tried using find and replace to get rid of it, but get an error message saying excel can't find any matching data to replace.
Does anyone know what this is, how to avoid it and how to get rid of it? I need to get rid of it because any record that has it wont import into Access. |
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Austin, Texas USA
Posts: 11,654
|
It might be a "smart quote". If this is a left-most character use...
=CODE(LEFT(A1)) ...to determine its ANSI code. Use... =CODE(RIGHT(A1)) ...if its a trailing character. Once you've determined the code use... =SUBSTITUTE(A1,CHAR(code),"") ...to get rid of it. [ This Message was edited by: Mark W. on 2002-04-24 12:34 ] |
|
|
|
|
|
#3 |
|
New Member
Join Date: Apr 2002
Posts: 9
|
Where do I place the formula to determine the code use, just in any cell that contains the character? How do I then replace all of them. And it is a left most character, like this:
'Maxine |
|
|
|
|
|
#4 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: Austin, Texas USA
Posts: 11,654
|
Quote:
Of course if a single left-most character was you only concern you could also use the formula, =RIGHT(A1,LEN(A1)-1), in C1 instead of =SUBSTITUTE(C1,CHAR(39),""). [ This Message was edited by: Mark W. on 2002-04-24 13:00 ] |
|
|
|
|
|
|
#5 |
|
Board Regular
Join Date: Apr 2002
Location: Minnesota
Posts: 821
|
The ' character is probably an old left-aligned label symbol from Lotus 123. And Excel can't find or replace them.
You can use =trim(yourcell) to fix it. Like the previous suggestion, insert a column, enter the formula, copy, paste special values to replace your orignal text. |
|
|
|
|
|
#6 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Austin, Texas USA
Posts: 11,654
|
cdenski, klb's posting makes sense. After re-reading your initial posting it occurred to me that you probably have the "Transition navigation keys" option checked on the Transition tab displayed by the Tools | Options... menu command. Uncheck it... and the single quotes (') that were not entered using the keyboard will disappear.
[ This Message was edited by: Mark W. on 2002-04-24 14:02 ] |
|
|
|
|
|
#7 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
|
Quote:
=A1&"" where A1 houses such an entry. 'Maxine should not be visible in the cell where it is, but just in the Formula Bar for the suggestion to work. |
|
|
|
|
|
|
#8 |
|
New Member
Join Date: May 2002
Posts: 39
|
Hi Gang,
This thread answered the exact problem that I was having with leading single quotes. However, after using Mark W.'s solution { (=SUBSTITUTE(C1,CHAR(39),"") }, Excel was adding the ' back as I copy and pasted special -> values back to the original cells. I worked around this by adding the following to Mark's equation: =SUBSTITUTE(C1,CHAR(39),"")+0 The addition of zero "tricked" Excel into formatting as a number instead of as text. I was then able to copy my new "numerical" values back into the original cells. Regards, mar4JC |
|
|
|
|
|
#9 |
|
New Member
Join Date: May 2002
Posts: 39
|
Actually, I just checked and the substitution formula is not really necessary. Just create a column with the following formula:
=A1+0, where A1 is the cell containing text with the leading single quote This will trick Excel into formatting the cell as a number instead of text. You can then copy paste special -> values back to the original cells. Easy! |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|