Hi Everyone,
I have A UserForm With 3 TextBoxes - TextBox1, TextBox2, TextBox3 (To Make This Example Simple)
I have the following codes in TextBox1:
Private Sub TextBox1_Change()
Me.TextBox1.Text = Format(Me.TextBox1.Text, "#,###,###,###")
TextBox3.Value = Val(TextBox1) * Val(TextBox2)
End Sub
TextBox2 Has the same code As TextBox1:
Private Sub TextBox2_Change()
Me.TextBox2.Text = Format(Me.TextBox2.Text, "#,###,###,###")
TextBox3.Value = Val(TextBox1) * Val(TextBox2)
End Sub
Now I want TextBox3 To Display The Total Of TextBox1 * TextBox2. I notice that when I have that code to format the number with the thousands separator, the total that shows in TextBox3 is only the multiplication of each textbox's value BEFORE the thousands separator. Hence, not displaying the proper value. BUT when I take off the formatting code, the multiplication works perfectly. Does anybody know how to fix this or what I am doing wrong? I noticed that this happens whenever I do any form of operation not just multiplication. I need the thousands separator in the TextBoxes to make it easier on the user's eyes, and ensure that they do not mistype a value.
For an Example: If TextBox1 = 10 And TextBox2 = 5,000. TextBox3 shows 50, opposed to 50,000.
Thank you for your help!
I have A UserForm With 3 TextBoxes - TextBox1, TextBox2, TextBox3 (To Make This Example Simple)
I have the following codes in TextBox1:
Private Sub TextBox1_Change()
Me.TextBox1.Text = Format(Me.TextBox1.Text, "#,###,###,###")
TextBox3.Value = Val(TextBox1) * Val(TextBox2)
End Sub
TextBox2 Has the same code As TextBox1:
Private Sub TextBox2_Change()
Me.TextBox2.Text = Format(Me.TextBox2.Text, "#,###,###,###")
TextBox3.Value = Val(TextBox1) * Val(TextBox2)
End Sub
Now I want TextBox3 To Display The Total Of TextBox1 * TextBox2. I notice that when I have that code to format the number with the thousands separator, the total that shows in TextBox3 is only the multiplication of each textbox's value BEFORE the thousands separator. Hence, not displaying the proper value. BUT when I take off the formatting code, the multiplication works perfectly. Does anybody know how to fix this or what I am doing wrong? I noticed that this happens whenever I do any form of operation not just multiplication. I need the thousands separator in the TextBoxes to make it easier on the user's eyes, and ensure that they do not mistype a value.
For an Example: If TextBox1 = 10 And TextBox2 = 5,000. TextBox3 shows 50, opposed to 50,000.
Thank you for your help!