Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
C Glenn
 
Posts: n/a
Default Removing errant apostrophes

I'm working with a spreadsheet produced by a scraper. For reasons that
I can only guess and am powerless to change, it places an apostrophe
before some of the numbers (IOW, one might imagine that it believes them
to be numeric strings).

I was hoping to find a way to remove them en masse, through search and
replace perhaps. But the search half of the process doesn't know how to
look for an apostrophe at the beginning of a cell. It seems that those
don't count.

Any ideas on how this could be automated?
  #2   Report Post  
Paul Sheppard
 
Posts: n/a
Default


C Glenn Wrote:
I'm working with a spreadsheet produced by a scraper. For reasons that
I can only guess and am powerless to change, it places an apostrophe
before some of the numbers (IOW, one might imagine that it believes
them
to be numeric strings).

I was hoping to find a way to remove them en masse, through search and
replace perhaps. But the search half of the process doesn't know how
to
look for an apostrophe at the beginning of a cell. It seems that
those
don't count.

Any ideas on how this could be automated?


Hi C Glenn

In an adjacent column try =TRIM(cellreference) eg =TRIM(A1), this will
remove the '

Then copy and paste special values


--
Paul Sheppard


------------------------------------------------------------------------
Paul Sheppard's Profile: http://www.excelforum.com/member.php...o&userid=24783
View this thread: http://www.excelforum.com/showthread...hreadid=476035

  #3   Report Post  
C Glenn
 
Posts: n/a
Default

That works!

I created a cell with your suggested formula pointing to one of the
errant cells, then copied it to a range of cells that would encompass
all of the cells that were not converted properly. (Fortunately, they
were contiguous; there were no cells having contents that would be
mangled by the TRIM process.) Now, the rest of my workbook can simply
point to those trimmed up cells. The data import process will have to
include a macro that automates this step.

Thanks.

Chris.

Paul Sheppard wrote:
C Glenn Wrote:

I'm working with a spreadsheet produced by a scraper. For reasons that
I can only guess and am powerless to change, it places an apostrophe
before some of the numbers (IOW, one might imagine that it believes
them
to be numeric strings).

I was hoping to find a way to remove them en masse, through search and
replace perhaps. But the search half of the process doesn't know how
to
look for an apostrophe at the beginning of a cell. It seems that
those
don't count.

Any ideas on how this could be automated?



Hi C Glenn

In an adjacent column try =TRIM(cellreference) eg =TRIM(A1), this will
remove the '

Then copy and paste special values


  #4   Report Post  
Gary''s Student
 
Posts: n/a
Default

You have found a very pesky fact. Apostrophes in the middle of text are easy
to remove, but leading apostrophes are more difficult.

Enter this tiny macro:

Sub tickout()
Dim r As Range
For Each r In Selection
r.Value = r.Value
Next
End Sub

Select the cells you want leading ticks (apostrophes) removed and call the
macro.
It will remove ticks but is not effective against fleas
--
Gary''s Student


"C Glenn" wrote:

I'm working with a spreadsheet produced by a scraper. For reasons that
I can only guess and am powerless to change, it places an apostrophe
before some of the numbers (IOW, one might imagine that it believes them
to be numeric strings).

I was hoping to find a way to remove them en masse, through search and
replace perhaps. But the search half of the process doesn't know how to
look for an apostrophe at the beginning of a cell. It seems that those
don't count.

Any ideas on how this could be automated?

  #5   Report Post  
C Glenn
 
Posts: n/a
Default

This is amazing! It works on ticks but not fleas!?!?

Hey, thanks. This is great. Really bizarre though --
r.Value = r.Value removes the leading apostrophe. Also, I don't get
that we would need to Dim r as Range. Seems like we should Dim c as
Cell. Isn't Cell a valid concept in this context? I'm still a little
new to Excel macros.





Gary''s Student wrote:
You have found a very pesky fact. Apostrophes in the middle of text are easy
to remove, but leading apostrophes are more difficult.

Enter this tiny macro:

Sub tickout()
Dim r As Range
For Each r In Selection
r.Value = r.Value
Next
End Sub

Select the cells you want leading ticks (apostrophes) removed and call the
macro.
It will remove ticks but is not effective against fleas

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
How to convert numbers with apostrophe's (ex. 219'2) to decimals? Kaci Excel Worksheet Functions 2 June 15th 05 03:48 PM
Removing trailing spaces from cells ? Don Guillett Excel Worksheet Functions 0 April 10th 05 03:32 PM
How do I stop excel removing zeros? tomcat Excel Discussion (Misc queries) 2 January 21st 05 05:40 PM
Removing ' character from cells Don Excel Discussion (Misc queries) 5 December 21st 04 05:41 PM
How do I obtain Curly quotes and apostrophes in Excel? Samito Excel Discussion (Misc queries) 1 December 7th 04 12:30 PM


All times are GMT +1. The time now is 05:46 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"