ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Convert input to numeric (https://www.excelbanter.com/excel-programming/376899-convert-input-numeric.html)

[email protected]

Convert input to numeric
 
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


Ken Johnson

Convert input to numeric
 

wrote:
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


Ken Johnson

Convert input to numeric
 

Which is a property of the Application object (I left out)

Ken Johnson



All times are GMT +1. The time now is 01:35 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com