
comma and point with numbers in textboxes in vba
You could use InStr function to find the point and then have it replace the
point with a comma before it evaluates the text box as shown below.
If InStr(1,UserForm1.TextBox1.Text,".",0) > 0 Then
Userform1.TextBox1.Text = Left(Userform1.TextBox1.Text, _
InStr(1,UserForm1.TextBox1.Text,".",0)-1) & "," & _
Right(UserForm1.TextBox1.Text,Len(UserForm1.TextBox1.Text) - _
InStr(1,UserForm1.TextBox1.Text,".",0)
End If
Ronald Dodge
Production Statistician
Master MOUS 2000
Quote:
> Hi,
> I've got a big problem and hope there is anybody who can help me.
> I use alot of userforms with textboxes in my program. Our seperartion of
> whole and decimal numbers is a comma Normaly if u use the point from the
> numeric keypad, excel automaticly makes it a comma But not if I use vba
> textboxes. I've tried to declare the textboxes as single, but that didn't
> work. Any suggestions?
> thanks,
> Hugo