Convert input to numeric

S

staeri

I have a very difficult problem that seems to be to hard for me to
solve. We use VBA forms with textboxes for input.

I'm in need of a converting function which works in all countries,
especially regarding decimal sign and thousand separator.

If I'm in Sweden where we use "," as decimal sign I want to be able to
also use "." and convert this to a numeric value.

If I'm in US where we use "." as decimal sign I want to be able to also
use "," and convert this to a numeric value.

The reason why I want to allow both signs is that the entered value is
used for other calculations so I need it to be numeric.

All kinds of help is very appreciated!

Regards,

SE
 
K

Ken Johnson

I have a very difficult problem that seems to be to hard for me to
solve. We use VBA forms with textboxes for input.

I'm in need of a converting function which works in all countries,
especially regarding decimal sign and thousand separator.

If I'm in Sweden where we use "," as decimal sign I want to be able to
also use "." and convert this to a numeric value.

If I'm in US where we use "." as decimal sign I want to be able to also
use "," and convert this to a numeric value.

The reason why I want to allow both signs is that the entered value is
used for other calculations so I need it to be numeric.

All kinds of help is very appreciated!

Regards,

SE

Hi SE,

You might be able to make use of the example in VBA Help under
"DecimalSeparator Property"

Ken Johnson
 

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