View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Ron Rosenfeld Ron Rosenfeld is offline
external usenet poster
 
Posts: 5,651
Default String to number

On Sun, 6 Nov 2005 14:25:19 -0600, Alf
wrote:


Importing from database to Excel numbers are converted to strings (ex
676 921,5)

I've tried to convert this to number by using "Paste Special" -
Multiply.
Did not work.

I then tried "Replace(" ","") and neither did this work.

I do think that the "space" in the number is not the normal
"space" (Unicode (Hex) 0020) but the "No-Breake Space" (Unicode (Hex)
00A0).

So if anybody could give me a hint of how to solve this problem (VBA by
preference) I would be verry happy. F2 works of cource but editing
several columns with 500 rows is not a job I'm looking forward to.

Alf



Try this:

=--TRIM(SUBSTITUTE(SUBSTITUTE(A1," ",""),CHAR(160),""))


--ron