Userform: ComboBox and TextBox updating total price

22 Views Asked by At

I am a beginner with VBA and trying to learn. I need help making my userform perform the following actions. ComboBox5 is a part number from sheet2 column A, TextBox2 displays the price on sheet2 column B based on part selected in ComboBox5. I need help trying to make ComboBox4 (Quantity) multiply against TextBox2 (Price) and display the total in TextBox3. Currently my code will multiply in Textbox2 however I need it to display the price in TextBox2 and the total in Textbox3. Here is my current code: Here is my sample code:

Private Sub ComboBox5_Change()
Me.TextBox2.Value = Application.VLookup(Me.ComboBox5.Value, 
Worksheets("Sheet2").Range("B1").CurrentRegion, 2, 0)
End Sub

Private Sub ComboBox4_AfterUpdate()
If ComboBox4.Value = "" Then Exit Sub
TextBox2.Value = ComboBox4.Value * TextBox2.Value
End Sub`
0

There are 0 best solutions below