rEMOVE SPACES

vikas0577

New Member
Joined
Jul 1, 2010
Messages
17
hI,
Is there a formula to remove spaces at the end of Text or numbers in the cells. for eg. I have got data as under

<TABLE style="WIDTH: 73pt; BORDER-COLLAPSE: collapse" cellSpacing=0 cellPadding=0 width=97 border=0 x:str><COLGROUP><COL style="WIDTH: 73pt; mso-width-source: userset; mso-width-alt: 3547" width=97><TBODY><TR style="HEIGHT: 15.75pt; mso-height-source: userset" height=21><TD class=xl22 id=td_post_256286 style="BORDER-RIGHT: #d4d0c8; BORDER-TOP: #d4d0c8; BORDER-LEFT: #d4d0c8; WIDTH: 73pt; BORDER-BOTTOM: #d4d0c8; HEIGHT: 15.75pt; BACKGROUND-COLOR: transparent" width=97 height=21>72200000.00 </TD></TR><TR style="HEIGHT: 15.75pt; mso-height-source: userset" height=21><TD class=xl22 style="BORDER-RIGHT: #d4d0c8; BORDER-TOP: #d4d0c8; BORDER-LEFT: #d4d0c8; BORDER-BOTTOM: #d4d0c8; HEIGHT: 15.75pt; BACKGROUND-COLOR: transparent" height=21>1000000.00 </TD></TR><TR style="HEIGHT: 15.75pt; mso-height-source: userset" height=21><TD class=xl22 style="BORDER-RIGHT: #d4d0c8; BORDER-TOP: #d4d0c8; BORDER-LEFT: #d4d0c8; BORDER-BOTTOM: #d4d0c8; HEIGHT: 15.75pt; BACKGROUND-COLOR: transparent" height=21>132283.00 </TD></TR><TR style="HEIGHT: 15.75pt; mso-height-source: userset" height=21><TD class=xl22 style="BORDER-RIGHT: #d4d0c8; BORDER-TOP: #d4d0c8; BORDER-LEFT: #d4d0c8; BORDER-BOTTOM: #d4d0c8; HEIGHT: 15.75pt; BACKGROUND-COLOR: transparent" height=21>59549.00 </TD></TR><TR style="HEIGHT: 15.75pt; mso-height-source: userset" height=21><TD class=xl22 style="BORDER-RIGHT: #d4d0c8; BORDER-TOP: #d4d0c8; BORDER-LEFT: #d4d0c8; BORDER-BOTTOM: #d4d0c8; HEIGHT: 15.75pt; BACKGROUND-COLOR: transparent" height=21>121534.00 </TD></TR><TR style="HEIGHT: 15.75pt; mso-height-source: userset" height=21><TD class=xl22 style="BORDER-RIGHT: #d4d0c8; BORDER-TOP: #d4d0c8; BORDER-LEFT: #d4d0c8; BORDER-BOTTOM: #d4d0c8; HEIGHT: 15.75pt; BACKGROUND-COLOR: transparent" height=21>16545.00 </TD></TR><TR style="HEIGHT: 15.75pt; mso-height-source: userset" height=21><TD class=xl22 style="BORDER-RIGHT: #d4d0c8; BORDER-TOP: #d4d0c8; BORDER-LEFT: #d4d0c8; BORDER-BOTTOM: #d4d0c8; HEIGHT: 15.75pt; BACKGROUND-COLOR: transparent" height=21>500.00 </TD></TR></TBODY></TABLE>

There are 2 spaces at the end of each cell value.
How to remove them.
Pl. help.
Thanks
Vikas
 
Dear Sektor,
I have pasted as per your steps, but does not work,
Can U explain step 5, I may be wrong on step 5

I am getting the RemSp in the run Macro, but nothing works on the cells.
 
Upvote 0

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Did you activate sheet with those numbers? Activate this sheet, press Alt+F8, select "RemSp" and press Run button.
BTW, what did you expect to see? Spaces are removed but visually you won't see this. To make sure they are removed, activate any cell with number and press F2. You should see that the last character is not a space.
 
Upvote 0
Dear Sektor,

It dose not work, Pl. provide me your email id so that I can mail you the xl file , then may be U can solve the issue.
Thanks
Vikas
 
Upvote 0
Have you tried copying one of the 'spaces' and using this in Find/Replace instead?

I had some issues yesterday with some spaces that weren't spaces and that seemed to solve it.
 
Upvote 0
assuming that your data is in A1. Try the below formula:

=LEFT(A1,LEN(A1)-2)

or if you want to remove any spaces (can be one or more spaces) from the end. You can try the below formula:

=SUBSTITUTE(A1," ","")
 
Upvote 0

Forum statistics

Threads
1,224,505
Messages
6,179,152
Members
452,891
Latest member
JUSTOUTOFMYREACH

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top