Hi
I have this procedure
this matches the item from combobox1 with column D and merge amount for column E and show in textbox1 for ORDERS sheet.
now I want at the same time match combobox1 with column B for column C contains amount and show amount in textbox2 for STOCK sheet.
so the question is , is there any procedure do that without repeat the same code for STOCK sheet ?
I have this procedure
VBA Code:
Private Sub ComboBox1_Change()
Dim ws As Worksheet, LR As Long, qtyP As Double, qtyT As Double
If ComboBox1.Value <> "" Then
Set ws = Sheets("ORDERS")
LR = ws.Cells(Rows.Count, 3).End(3).Row
qtyP = WorksheetFunction.SumIf(ws.Range("D2:D" & LR), ComboBox1.Value, ws.Range("E2:E" & LR))
qtyT = qtyT + qtyP
TextBox1.Text = qtyT
End If
End Sub
now I want at the same time match combobox1 with column B for column C contains amount and show amount in textbox2 for STOCK sheet.
so the question is , is there any procedure do that without repeat the same code for STOCK sheet ?