Hi
I need a formula to remove blank spaces at the end of the text in a cell.
Thanks
Regards
Hi
I need a formula to remove blank spaces at the end of the text in a cell.
Thanks
Regards
Last edited by tek9step; 02-26-2010 at 05:16 AM.
Assuming they are genuine spaces a basic TRIM should suffice.
If the TRIM does not work then run CODE(RIGHT(A1)) to determine trailing character and post back.
My Recommended Reading:
Volatility
Sumproduct & Arrays
Pivot Intro
Email from XL - VBA & Outlook VBA
Function Dictionary & Function Translations
Dynamic Named Ranges
Morning DO
Trim didnt work. Please find attached test file.
regards
It seems the trailing char occurs only once per string so either
a) =LEFT(A1,LEN(A1)-1)
or
b) =SUBSTITUTE(A1,CHAR(160),"")
Thanks DO
I understand Substitue function but could you explain Char function & CODE(RIGHT(A1)) function actually do.
Thanks
Regards
I'm guessing you know what RIGHT does, correct ?
CODE will return the code number for a given character in relation to the character set in operation (assuming Char is valid of course).
CHAR does the opposite of CODE - it takes the code number and reverts to Character
Consider:
A1: Apple!
B1: =CODE(RIGHT(A1))
returns 33 for me... that is the CODE # associated with ! in my character set.
C1: =CODE(LEFT(A1))
reutrns 65 as that i the CODE# associated with A
conversely
D1: =CHAR(B1)
copied to E1
will return ! and A respectively... ie reverts the CODE number to character.
If you want to see the listing per your character set:
F1: =CHAR(ROW())
copied to F255
(pending your version you will probably find the first 32 appear pretty much blank - they aren't they just don't display)
NOTE: by character set we mean to differentiate between Windows & Mac.
Thanks DO it makes more sense now. Yes Right Left i understand.
Regards![]()
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks