comma and point with numbers in textboxes in vba 
Author Message
 comma and point with numbers in textboxes in vba

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



Fri, 21 Jan 2005 22:04:38 GMT  
 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



Fri, 21 Jan 2005 23:32:18 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Replace point in a textbox to a comma in excel97

2. How to have decimal points and commas for numbers at a PivotChart

3. Flipping commas and decimal points (for European number formatting)

4. Getting rid of the comma in a number using VBA

5. How to test in vba for floating point not a number values

6. column of numbers to row of comma separated numbers

7. Converting floating point number to IEEE 32-bit precision floating point format

8. How to change comma to point

9. Comma vs Point

10. decimal point vs comma in forms


 
Powered by phpBB® Forum Software © phpBB Group