How to find out a string starts with apostrophe?

  • Thread starter Thread starter Eric
  • Start date Start date
E

Eric

I have 500 rows data all located at col "A", some of text
beginning with an apostrophe and some don't.

I need a solution to either remove all extra apostrophe
from the beginning of text, or add an apostrophe to those
texts without one.

Thanks in advance,
 
Hi
try the following (works on your current selection)
sub remove_it()
dim rng as range
set rng = selection
rng.value=rng.value
end sub
 
Eric,

Try something like

Dim Rng As Range
For Each Rng In
Range("A1:A500").SpecialCells(xlCellTypeConstants)
Rng.Value = Rng.Value
Next Rng

This will remove all the leading ' characters.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top