Hello my Dear
Please I want to Set the code to get the textbox values..for Exalmple when I choose any Items from ComboBox1 and put any figure in TextBox1 as 200
i want the Result for TextBox2 ,TextBox3 and TextBox4 as data in Sheet 1 ,when i choose item A and Put 200 in TextBox1 ,it will be textBox2.value =(200*66%)is 132
and textBox3.value =(200*84%)is 168.......... etc
Please I want to Set the code to get the textbox values..for Exalmple when I choose any Items from ComboBox1 and put any figure in TextBox1 as 200
i want the Result for TextBox2 ,TextBox3 and TextBox4 as data in Sheet 1 ,when i choose item A and Put 200 in TextBox1 ,it will be textBox2.value =(200*66%)is 132
and textBox3.value =(200*84%)is 168.......... etc
Code:
Private Sub CommandButton1_Click()
On Error Resume Next
Dim ws As Worksheet
Set ws = Sheets("Sheet1")
Me.TextBox2.Value = (Val(Me.TextBox1.Value) * WorksheetFunction.VLookup(Val(Me.ComboBox1.Value), ws.Range("a2:d20"), 2, 0))
Me.TextBox3.Value = (Val(Me.TextBox1.Value) * WorksheetFunction.VLookup(Val(Me.ComboBox1.Value), ws.Range("a2:d20"), 3, 0))
Me.TextBox4.Value = Me.TextBox1.Value * WorksheetFunction.VLookup(Val(Me.ComboBox1.Value), ws.Range("a2:d20"), 4, 0)
End Sub