Blue_Wings
New Member
- Joined
- Aug 23, 2019
- Messages
- 11
Hi, I have been searching without success for the following:
I have a imputbox to receive euros, if the user wants to insert for example the number 55.20, afterwords I will use that number to do another calculation, but is giving me an error because its inserted with a dot as a decimal separator instead of a comma, if I use a dot separator gives me the following error:
Run-time error'13': Type mismatch
Can I use something like: resposta = Replace(Textnumber.Value, ".", ",") to force the change from dot to comma to avoid the system error?
Example of the code:
Thank you.
I have a imputbox to receive euros, if the user wants to insert for example the number 55.20, afterwords I will use that number to do another calculation, but is giving me an error because its inserted with a dot as a decimal separator instead of a comma, if I use a dot separator gives me the following error:
Run-time error'13': Type mismatch
Can I use something like: resposta = Replace(Textnumber.Value, ".", ",") to force the change from dot to comma to avoid the system error?
Example of the code:
Code:
Dim resposta As Variant
resposta = InputBox("Valor da Nota de Débito")
Dim ValorQuota As Variant
ValorQuota = WorksheetFunction.Sum(Range("H4:H5"))
Dim Resultado As Variant
Resultado = resposta / ValorQuota
MsgBox Resultado
Thank you.