delete ALL spaces in text string

Status
Not open for further replies.

choeg

New Member
Joined
Jun 5, 2002
Messages
15
Hi,

I've been trying to remove all spaces from a text string, but can't get it to work. The TRIM() function only removes some spaces, but not all...

Problem:
I paste info from another application into Excel in the following format.
e.g. "100 000.00" (could also be 100 000 000.10, or many other combos).
This is interpreted as text in Excel, since there are spaces hard coded in between the numbers.

Goal:
Have Excel interpret this as a number. (e.g. "100000").

For some reason I can't get the (text) substitute function to work (e.g. substitute(A1," ", "").

I am using Excel 97. I don't mind using VBA, but would prefer not to.

Any help would be appreciated.

/Carl
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
The formula:

=VALUE(SUBSTITUTE(A1," ",""))

worked for me.

At first I was going to write "fine for you, but it doesn't work for me", but after experimenting a bit I found out that it works for me if I type in
"100 000.00" and runs the formula for that cell. However, it doesn't work for the data I have pasted (from the application)!

Is there another character that looks like a space? How can I figure out which one it is (and remove it)?

/Carl
 
Upvote 0
It could be that the cells containing the data is formatted to display spaces but doesn't actually have any...

If you pasted the data from another application, that isn't unlikely.
 
Upvote 0
Status
Not open for further replies.

Forum statistics

Threads
1,214,430
Messages
6,119,453
Members
448,898
Latest member
drewmorgan128

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