excel saves as text not as a number

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

i hav
AMERICA'S CHOICE 400 ANYTIME $39.99 2Y 0204 --- 56290[ $39.99]
i got the 2 and the 39.99 out of the text by using the find equation, but when i copy and paste elsewhere it saves it as text and not a number

any ideas how to get it to save as a number
 
Hi
you have to convert the result of a string operation to a number. e.g.
with
CDbl(string)
--(string)

you may post your code which you're currently using to get a more
specific answer

--
Regards
Frank Kabel
Frankfurt, Germany

jeff said:
i have
AMERICA'S CHOICE 400 ANYTIME $39.99 2Y 0204 --- 56290[ $39.99] 0
i got the 2 and the 39.99 out of the text by using the find equation,
but when i copy and paste elsewhere it saves it as text and not a
number.
 
Hi
just saw Rob's answer to your previous post - please stay in the same
thread if you have further questions to a solution provided to you :-)

Change Rob's formulas to

To get the 2:
=--MID(A3,FIND("Y ",A3,FIND(" $",A3,1))-1,1)

to get the $39.99
=--MID(A3,FIND("[ ",A3,FIND("---",A3,1))+2, FIND("]
",A3,FIND("---",A3,1)) -
FIND("[ ",A3,FIND(" $",A3,1))-2)


--
Regards
Frank Kabel
Frankfurt, Germany

jeff said:
i have
AMERICA'S CHOICE 400 ANYTIME $39.99 2Y 0204 --- 56290[ $39.99] 0
i got the 2 and the 39.99 out of the text by using the find equation,
but when i copy and paste elsewhere it saves it as text and not a
number.
 
Probably the only thing to add to Frank's answer for
your information is that CDbl (conversion to Double byte
floating point) will remove comma and $ sign in the conversion.
in this case from a string to a number. If placed into a cell
you would want to format the cell to your preference.

Dim myValue As Double
myValue = CDbl("$29,123.45") 'include $ and commas for a test
MsgBox myValue 'to display for testing

If you had kept to your original thread as Frank indicated we would
not have to guess what it was that you started with one string
or different parts in separate cells.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top