My regional Settings are set as European.
I have a userform that I would like to allow everyone to input values with "," or "." for that I need vba to change the value that user inputs.
I have the following code:
If (CDbl(Replace(txtValor, ".", ","))) <> CDbl(txtValor) Then
Cartao = CDbl(Replace(txtValor, ".", ","))
Else
Cartao = CDbl(txtValor)
End If
However when I run the form I am still getting "type Mismatch" when a user enters a value with "." like "15.20"
This is not happening if the user use the "," like "15,20"
Am I using the Replace function wrong?
Thanks for your help in advance.
Bookmarks