I have pasted a large range of values - slightly inconvenient these values contain spaces, like this:
104 232
97 122
89 396
87 247
Since its numbers the substitute function doesn't work. Any suggestions how to crack this?
Thanks.
I have pasted a large range of values - slightly inconvenient these values contain spaces, like this:
104 232
97 122
89 396
87 247
Since its numbers the substitute function doesn't work. Any suggestions how to crack this?
Thanks.
Last edited by Jonathan9; 01-14-2014 at 01:10 PM.
Since its numbers the substitute function doesn't work.
Sure it does:Formula:Please Login or Register to view this content.
Regards, TMS
Trevor Shuttleworth - Retired Excel/VBA Consultant
I dream of a better world where chickens can cross the road without having their motives questioned
'Being unapologetic means never having to say you're sorry' John Cooper Clarke
I note that you have been active on the forum since this solution was posted. Please let me know if it resolves your issue.
If you are satisfied with the solution(s) provided, please mark your thread as Solved.
New quick method:
Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.
Or you can use this way:
How to mark a thread Solved
Go to the first post
Click edit
Click Go Advanced
Just below the word Title you will see a dropdown with the word No prefix.
Change to Solved
Click Save
You may also want to consider thanking those people who helped you by clicking on the little star at the bottom left of their reply to your question.
BTW, I would also think find and replace would work, it did when I tried it.
Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
Sam Capricci
@Sambo kid: absolutely, no reason why not ... and leaves real numbers. I was just addressing the assertion that "the substitute function doesn't work."
Regards, TMS
Sure, got it. I'm sure it didn't slip your mind, just thought I'd mention it to the OP. BTW, I wondered why you had the two dashes in front of the formula, I had success w/substitute w/o them, then I tried it with them and saw it formatted as # instead of text. Cool.
That's why I like this forum, I always learn stuff... thx.
@Sambo kid: yes, use a double negative to coerce a text number into a real number. Or, you can multiply by 1, or you can add 0
Formula:Please Login or Register to view this content.
Formula:Please Login or Register to view this content.
Formula:Please Login or Register to view this content.
Not a lot in it, more a matter of personal taste. Note that they ALL fail if the cell is empty or contains spaces. SO you'd need an IFERROR to cater for that.
Regards, TMS
Last edited by TMS; 01-14-2014 at 09:05 AM.
@Sambo kid: thanks for the feedback and rep.
Thanks for the reply!
Unfortunately it didn't work. For some reason I get Error in value. However, if I just write in a cell and then do the --substitute formula then it works. So it's something fishy about the pasted values. I ran clean, trim and repasted as values but it still won't work for some reason.
you referring to my recommendation about find "space" and replace all "" or TMS's rec?
It might help if you provided a sample workbook showing what you are working with?
1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
2. If your question is resolved, mark it SOLVED using the thread tools
3. Click on the star if you think someone helped you
Regards
Ford
Try this
=--SUBSTITUTE(A2,CHAR(160),"")
If you like my answer please click on * Add Reputation
Don't forget to mark threads as "Solved" if your problem has been resolved
"Nothing is so firmly believed as what we least know."
--Michel de Montaigne
I think Find/Replace should works
Ctrl-H
Find what":<hit space bar>
Replace with: <leave it blank>
Quang PT
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks