When i copy and paste a table with numbers from an email to excel, there will be spaces before the numbers. Is there an easy formula to remove these spaces (i tried to add an image, but my post was removed)
Edit: thank you all for the support. The following formula solved it
=0+SUBSTITUTE(B2,CHAR(160),"")
Edit 2:
u/semicolonsemicolon & u/Joe3453 deserves credit for recognizing nbsp being the issue.
For curious lurkers: https://en.wikipedia.org/wiki/Non-breaking_space
Remove space(s) before a numerical value within a cell
excel tricks to remove spaces at the beginning and ending of the cells?
Remove Space Between Numbers in Excel
removing blank spaces before numbers
Re: have removed spaces but some are still there.
Importing data can bring in unwanted spaces and other characters.
The 'non breaking space', character 160, is one of them.
From 10 years ago...
Using Replace:
Select the column or columns with data in it,
Press CTRL+H to bring up the Replace dialog box.
In the "Find what" field, type ALT+0160 using only the Number Pad to type in the digits.
To be safe: type a single space character into the "Replace with" field
Next, click the "Options" button to reveal all the available options and make sure
the check box labeled "Match entire cell contents" does not have a check mark in it.
Finally, click the "Replace All" button.
'---
Or you can select one of the left over spaces and paste it into the Replace dialog box.
Or you could use a formula =SUBSTITUTE(D1,CHAR(160),"")
Or you could avail yourself of my free 'Professional Compare' workbook, which has a "Clean Data" utility. It provides several options. Download from OneDrive...
https://1drv.ms/u/s!Au8Lyt79SOuhZw2MCH7_7MuLj04?e=sAwbHU
'---
Nothing Left to Lose
.... Excel
tricksto remove spaces at thebeginningandendingof the cells?
One of my very first vba codes added to the toolbar was a code to clean input data. On each cell, use Replace to remove Chr(160), followed by using the function "Clean", and then "Trim".
Vba's TRIM() function does what you want: Removes Spaces at the beginning and end. The worksheet TRIM is slightly different because it also removes extra spaces in the middle.
If trim isn’t working for you, why not do a simple find and replace of the “space” character. That may well work for you.
I know this is a very basic function but even after searches and a YouTube video, I can’t seem to find how to do this and funny, I’ve done it before…
I need to remove the spaces in a row…I’ve tried following examples of the TRIM function but it just doesn’t seem to be working correctly…
Here’s what the numbers look like:

I have about 280 of these and only need the spaces removed from those numbers all in the same column.
Thanks…
