#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Text Cell

I have a series of data imported into a spreadsheet. After Importing, there
is an apostrophie in the first character and two spaces at the end of the
text that the trim function will not remove.
Has anyone seen this error and if so do you know how to remove the
apostrophie and the end spaces?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Text Cell

ActiveCell.Value = Trim(Application.Substitute(ActiveCell.Text,chr(16 0),"
"))

worked for me.
--
Regards,
Tom Ogilvy



"Dan T" .(donotspam) wrote in message
...
I have a series of data imported into a spreadsheet. After Importing,

there
is an apostrophie in the first character and two spaces at the end of the
text that the trim function will not remove.
Has anyone seen this error and if so do you know how to remove the
apostrophie and the end spaces?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Text Cell

As I said, it removed the apostrophe for me and use

ActiveCell.Value = ActiveCell.Text

or even
ActiveCell.Value = ActiveCell.Value

Is a common way to overcome this problem.

The apostrophe is treated as a formatting character and forces the value of
the cell to be text. Even if it stays, if you cell should be text, it
doesn't create a problem, but as I said, the method I provided does remove
it. I can only imagine you altered it in some way or the cell is other than
what you have described.

Mid
it isn't looking at the letters as one. It is ignoring the apostrophy

Do an =Len(A1) on your cell and you will see the apostrophy isn't counted.

Regards,
Tom Ogilvy

"Dan T" .(donotspam) wrote in message
...
Ok, Tried that, but it still has the apostrophie in the front. If I try

the
Mid function to remove the first character it removes the first letter

with
it so somehow it is looking at the letter and the apostrophie as one,
although they appear seperate when I activate the cell.


"Tom Ogilvy" wrote:

ActiveCell.Value =

Trim(Application.Substitute(ActiveCell.Text,chr(16 0),"
"))

worked for me.
--
Regards,
Tom Ogilvy



"Dan T" .(donotspam) wrote in message
...
I have a series of data imported into a spreadsheet. After Importing,

there
is an apostrophie in the first character and two spaces at the end of

the
text that the trim function will not remove.
Has anyone seen this error and if so do you know how to remove the
apostrophie and the end spaces?






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 manually copy text from one cell to end of other text cell philippe Excel Discussion (Misc queries) 3 December 22nd 09 04:49 PM
Enter text in a cell to return a text value in same cell Danno 24/7[_2_] Excel Discussion (Misc queries) 6 May 9th 08 06:26 AM
Copy text from cell to cell with one cell changing text Bobby Excel Worksheet Functions 5 March 15th 07 11:09 PM
Deleting Rows based on text in cell & formatting cell based on text in column beside it Steve Excel Programming 4 February 26th 04 03:31 PM
extracting text from within a cell - 'text to rows@ equivalent of 'text to columns' Dan E[_2_] Excel Programming 4 July 30th 03 06:43 PM


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