Hi everyone...im facing a problem when triyng to clear all the textboxes with a click event...
i triyed a loto of codes and none of them worked...with this exemple im facing a overflow error...
in textox4 the value must be 1.008 and textbox5 1000
can you help me?
thank you.
i triyed a loto of codes and none of them worked...with this exemple im facing a overflow error...
VBA Code:
Private Sub TextBox1_Change()
TextBox3 = TextBox1
TextBox7 = Val(TextBox6) / Val(TextBox3) * Val(TextBox4) * Val(TextBox5)
TextBox7 = Replace(Format(Val(TextBox6) / Val(TextBox3) * Val(TextBox4) * Val(TextBox5), "0.0000"), ",", ".")
End Sub
Private Sub TextBox2_AfterUpdate()
TextBox3 = CDbl(TextBox1) + CDbl(TextBox2)
TextBox7 = Val(TextBox6) / Val(TextBox3) * Val(TextBox4) * Val(TextBox5)
TextBox7 = Replace(Format(Val(TextBox6) / Val(TextBox3) * Val(TextBox4) * Val(TextBox5), "0.0000"), ",", ".")
End Sub
Private Sub TextBox3_Change()
TextBox3 = Abs(Val(TextBox1) - Val(TextBox2))
End Sub
Private Sub TextBox6_Change()
TextBox7 = Val(TextBox6) / Val(TextBox3) * Val(TextBox4) * Val(TextBox5)
TextBox7 = Replace(Format(Val(TextBox6) / Val(TextBox3) * Val(TextBox4) * Val(TextBox5), "0.0000"), ",", ".")
End Sub
Private Sub CommandButton1_Click()
Dim x As Integer
For x = 1 To 19
Select Case x
Case 8, 9
' do nothing
Case Else
Me.Controls("textbox" & x).Value = ""
End Select
Next x
End Sub
in textox4 the value must be 1.008 and textbox5 1000
can you help me?
thank you.
Last edited by a moderator: