apostrophe

D

Dana

How do you remove the apostrophe in a cell? I have numbers and text imported
from another program.
 
N

Norman Jones

Hi Dana,

One way:

Sub DeleteApostrophes()
Dim rCell As Range
Dim Rng As Range

Set Rng = ActiveSheet.UsedRange '<<=== CHANGE

For Each rCell In Rng
If rCell.PrefixCharacter = "'" Then
rCell.Value = rCell.Value
End If
Next rCell
End Sub

If you do not wish the procedure to operate on the whole sheet. you should
set Rng to an appropriately restricted range.
 
G

Gord Dibben

Dana

If your numbers appear as '1234

Copy a blank cell formatted to General.

Select your cell with '1234 and Paste Special>Add>OK>Esc.

Also works on pure text such as 'Dana

Gord Dibben Excel MVP
 
R

Ragdyer

If you have them in a column, simply select the column,
And <Data> <TextToColumns> <Finish>
And you're done!
 
R

Rojee

Select the Cell with apostrophe use the find and replace
function.
Replace apostrophe with "blank"
 
Top