convert a string to a double

G

Guest

I am trying to convert a string absolutely contains a number at all times to
a double for use of comparison and numerical calculation, VBA doesn't seem to
support the System.Convert.ToDouble() method... I have searched and searched
and can't find a way to do this... any help would be VERY appreciated!

For a little extra info (for anyone who wants to know) the number stored in
the text field is a four digit number with no decimal or anything else fancy
like that. I would not hesitate converting it to a different number if it
were easier.
 
G

Guest

Apparently I can manipulate the string as a number directly... hmm... that is
interesting, but is it safe?
 
D

Dirk Goldgar

SrMousse said:
Apparently I can manipulate the string as a number directly... hmm...
that is interesting, but is it safe?

Probably you're seeing the effect of an implicit conversion to one of
the number types. You can use either the CDbl() function or the Val()
function to explicitly convert your string to a Double.
 

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

Top