Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Trim function in Excel Doesn't work for certain cells

Hi,

Could someone help me with this problem!

My Excel sheet has a Macro which has a procedure to
remove spaces from the cell value and insert in to
another Sheet.
Eg:My code is as simple as follows:

b = Sheets("ABC").Range("A5").value
Sheets("XYZ").Range("A1").value = Trim(b)

This Trim function removes forward and back spaces in
some Cells, but just ignores spaces in some Cells, and as
a result in the output i get some Cells with the Spaces
in the values.
I wonder if Excel has a variety of Spaces which are
different from each other, Because my Macro handles
certain spaces and ignores others???

I Appreciate any help.
Thanks,
Neeraja.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 96
Default Trim function in Excel Doesn't work for certain cells

If you're trying to remove spaces between words, and on both ends.

Application.WoksheetFunction.Trim

--------------------------------------------------------------------------------------------------------------

I believe that space is Char 32.

http://www.rpi.edu/~kirkd/ascii/

--------------------------------------------------------------------------------------------------------------

Chip Person's CellView add-in allows you to see the exact characters
in a cell, as well as their character codes (in either decimal or hex
numbers).

http://www.cpearson.com/excel/cellview.htm

--------------------------------------------------------------------------------------------------------------

David McRitchie's Trimall macro helps to remove 'spaces' that aren't
really spaces.

http://www.mvps.org/dmcritchie/excel/join.htm#trimall

HTH
Paul
--------------------------------------------------------------------------------------------------------------
Be advised to back up your WorkBook before attempting to make changes.
--------------------------------------------------------------------------------------------------------------
Hi,

Could someone help me with this problem!

My Excel sheet has a Macro which has a procedure to
remove spaces from the cell value and insert in to
another Sheet.
Eg:My code is as simple as follows:

b = Sheets("ABC").Range("A5").value
Sheets("XYZ").Range("A1").value = Trim(b)

This Trim function removes forward and back spaces in
some Cells, but just ignores spaces in some Cells, and as
a result in the output i get some Cells with the Spaces
in the values.
I wonder if Excel has a variety of Spaces which are
different from each other, Because my Macro handles
certain spaces and ignores others???

I Appreciate any help.
Thanks,
Neeraja.


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
Trim function to remove blank spaces in Excel Natty Excel Discussion (Misc queries) 1 June 26th 08 03:31 PM
TRIM function Chimelle Excel Worksheet Functions 5 March 6th 08 09:45 PM
TRIM function fitou_learn[_2_] New Users to Excel 2 June 12th 07 11:06 AM
Need help with TRIM function Phil Excel Worksheet Functions 9 October 21st 05 08:02 PM
using trim cmd. When I type this command it does not work. When I. Rafiq Excel Worksheet Functions 1 January 5th 05 01:37 PM


All times are GMT +1. The time now is 12:28 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"