i have a quantity box and a price box and naturally a total. how do i multiply the first two boxes to put the price in the third.
this is what i have so far and its not working
[vba]TextBox1e = TextBox1a.Value * TextBoxq1.Value[/vba]
Printable View
i have a quantity box and a price box and naturally a total. how do i multiply the first two boxes to put the price in the third.
this is what i have so far and its not working
[vba]TextBox1e = TextBox1a.Value * TextBoxq1.Value[/vba]
This works for me
Code:Private Sub UserForm_Initialize()
TextBox1.Value = 3
TextBox2.Value = 2
TextBox3.Value = TextBox1.Value * TextBox2.Value
End Sub
thats only works once. i want to change one of the numbers and have the total update.
use textbox change or update
I had the Change but its not working.
[vba]Sub txtq1_Change()
txt1e = txt1q.Value * txt1d.Value
End Sub[/vba]
Code:Private Sub TextBox1_AfterUpdate()
DoUpdate
End Sub
Private Sub TextBox2_AfterUpdate()
DoUpdate
End Sub
Sub DoUpdate()
If TextBox1.Value = "" Then TextBox1.Value = 0
If TextBox2.Value = "" Then TextBox2.Value = 0
TextBox3.Value = TextBox1.Value * TextBox2.Value
End Sub