Diwas R Bhattarai
New Member
- Joined
- Jan 16, 2018
- Messages
- 9
Hi,
I have a userform with several textbox (Arrow1, Arrow2,........). When the form opens, the text box are populated from values in a worksheet:
code is
Private Sub Arow3_Change()
On Error Resume Next
Me.Arow2.RowSource = ""
Me.Arow4 = Application.WorksheetFunction.VLookup(Me.Arow2, Sheet5.Range("Data"), 2, 0)
Me.Arow6 = Application.WorksheetFunction.VLookup(Me.Arow2, Sheet5.Range("Data"), 4, 0)
Me.Arow5 = Application.WorksheetFunction.VLookup(Me.Arow2, Sheet5.Range("Data"), 6, 0)
If Me.Arow3.Value > "" Then Me.Arow7 = Me.Arow3.Value * Me.Arow6.Value
On Error GoTo 0
End Sub
Reference
"Data" refers to a name range, Data Range "2" refers to "Code no.", Data Range "4" refers to "Sale Price" & Data Range "6" refers to "Stock", where as Arrow 3 is named "Quantity" Arrow 4 is named "Code No." Arrow 5 is named "Stock", Arrow 6 is named "Sale Price" & Arrow 7 is named "Total"
What i need to do is on Arrow 6 i need to put the value manually on the user form which will be calculated on Arrow 7 (Quantity * Sale Price = Total)
How can i do that on the same above give code
Thanks
Diwas
I have a userform with several textbox (Arrow1, Arrow2,........). When the form opens, the text box are populated from values in a worksheet:
code is
Private Sub Arow3_Change()
On Error Resume Next
Me.Arow2.RowSource = ""
Me.Arow4 = Application.WorksheetFunction.VLookup(Me.Arow2, Sheet5.Range("Data"), 2, 0)
Me.Arow6 = Application.WorksheetFunction.VLookup(Me.Arow2, Sheet5.Range("Data"), 4, 0)
Me.Arow5 = Application.WorksheetFunction.VLookup(Me.Arow2, Sheet5.Range("Data"), 6, 0)
If Me.Arow3.Value > "" Then Me.Arow7 = Me.Arow3.Value * Me.Arow6.Value
On Error GoTo 0
End Sub
Reference
"Data" refers to a name range, Data Range "2" refers to "Code no.", Data Range "4" refers to "Sale Price" & Data Range "6" refers to "Stock", where as Arrow 3 is named "Quantity" Arrow 4 is named "Code No." Arrow 5 is named "Stock", Arrow 6 is named "Sale Price" & Arrow 7 is named "Total"
What i need to do is on Arrow 6 i need to put the value manually on the user form which will be calculated on Arrow 7 (Quantity * Sale Price = Total)
How can i do that on the same above give code
Thanks
Diwas