With tabel in sheet2 for products and prices
and code in sheet1
Private Sub Worksheet_Change(ByVal Target As Range)
Dim myrow As Long, myprice As Double
If Target.Row > 4 Then
If Target.Column > 1 And Target.Column < 11 And Target.Count = 1 Then
If Target = "" Then Exit Sub
Cells(3, Target.Column).Value = Cells(3, Target.Column).Value + Target.Value
myproduct = Cells(4, Target.Column)
With Sheets("sheet2")
myprice = Application.VLookup(myproduct, .Range("A:B"), 2, False)
End With
Cells(2, Target.Column).Value = Cells(2, Target.Column).Value + (Target.Value * myprice)
End If
End If
End Sub
Kind regards
Leo
Bookmarks