So basically my regional settings are set to European.
I have a userform that I would like to make sure that all values are passing correctly. What I mean is, when a user passes a decimal value to the form this value would be correctly calculated.
I tried using this to make sure that this happens, but when I run the form and test it by putting a value in the way "125.25"
I get "type Mismatch"
If I put "125,25" it works fine.
Am I using the replace function wrong here?
Thanx for the help in advance
I have a userform that I would like to make sure that all values are passing correctly. What I mean is, when a user passes a decimal value to the form this value would be correctly calculated.
Code:
If (CDbl(Replace(txtValor, ".", ","))) <> CDbl(txtValor) Then
Cartao = CDbl(Replace(txtValor, ".", ","))
Else
Cartao = CDbl(txtValor)
End If
I tried using this to make sure that this happens, but when I run the form and test it by putting a value in the way "125.25"
I get "type Mismatch"
If I put "125,25" it works fine.
Am I using the replace function wrong here?
Thanx for the help in advance