Thread: text to number
View Single Post
  #4   Report Post  
David McRitchie
 
Posts: n/a
Default text to number

Hi David,
If you mean like in check protection with wording like
Fourteen Dollars and Ninety-Eight Cents
see links at
Numbers to words (as in check protection wording) (#numberstowords)
http://www.mvps.org/dmcritchie/excel...numberstowords
nothing to convert those words back to numbers.

If you mean text that looks like numbers but is text and probably left
aligned. Then you want to change the format to number or general
and then you can run a macro like TrimALL which will reenter the
values stripping any leading and trailing spaces after converting
the nonbreaking space character Char(160) to spaces Char(20).
To convert to text instead, format the cells as text then run the TrimALL
macro. http://www.mvps.org/dmcritchie/excel/join.htm#trimall

Instead of running a macro, if you don't have unprintable characters
and don't want to run a macro -- though since you posted to programming
would assume either solution is fine. You could copy an empty cell
and add that to the column of cells via Ctrl+G (Edit, GoTo), then
the Special Button, then add. To convert to text after formatting as
text do the same add empty cell.

Suggest you test on a copy of the worksheet as your data will be changed.
If dates are involved you will certainly have to test what you are doing.

If none of the above then you will certainly have to provide an example
of what you are talking about.
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"DMc2005" wrote in message ...
Hi

i know there is a function to covert a number to text, is there a function
to convert text to a number.

D