jmaocubo
11-02-2011, 09:02 AM
Hi!!!!
I have a userform with two TextBox. The aim is to divide the value of textbox1 with textbox2.
I am using the following code:
Private Sub CommandButton1_Click()
' P2
If TextBox1.Value <> "" And TextBox2.Value <> 0 Then
Sheets("Auxiliar").Range("H2").Value = TextBox1.Value
Sheets("Auxiliar").Range("I2").Value = TextBox2.Value
Sheets("Auxiliar").Range("D2").Value = (TextBox1.Value / TextBox2.Value)
TextBox1.Value = ""
TextBox2.Value = ""
End If
UserForm2.Hide
End Sub
So far so good .... the problem is if you use "." or "," as decimal separator.
ex: 1.2 /1 i get 12
using 1,2 / 1 i get 1,2
Is there any way the calculation is the same with "." or ","?
Thanks in advance
Miguel
I have a userform with two TextBox. The aim is to divide the value of textbox1 with textbox2.
I am using the following code:
Private Sub CommandButton1_Click()
' P2
If TextBox1.Value <> "" And TextBox2.Value <> 0 Then
Sheets("Auxiliar").Range("H2").Value = TextBox1.Value
Sheets("Auxiliar").Range("I2").Value = TextBox2.Value
Sheets("Auxiliar").Range("D2").Value = (TextBox1.Value / TextBox2.Value)
TextBox1.Value = ""
TextBox2.Value = ""
End If
UserForm2.Hide
End Sub
So far so good .... the problem is if you use "." or "," as decimal separator.
ex: 1.2 /1 i get 12
using 1,2 / 1 i get 1,2
Is there any way the calculation is the same with "." or ","?
Thanks in advance
Miguel