I notice strange and anonymous behavior in excel, probably due to the different number notation in Belgium. When I type this in the immediate window, I get counter-intuitive results:
?val("0,5") 0 ?val("0.5") 0,5
so my workaround is to use it that way (usually the string “0.5” is replaced with textbox.value)
val(replace("0,5",",","."))
Also, when you use the numberformat () function, this leads me to such problems.
First, I had a Keypresses restriction in the text box:
Select Case KeyAscii Case vbKey0 To vbKey9, vbKeyBack, vbKeyClear, vbKeyDelete, vbKeyLeft, _ vbKeyRight, vbKeyUp, vbKeyDown, vbKeyTab, vbDecimal Case Else KeyAscii = 0 Beep End Select
But vbDecimal would let me type '.' as a decimal point, and then at runtime it will be interpreted as a time value of 1000.
Any light?