Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Rng As Range, i As Long, Screw_ As Long, Nut_ As Long, Hinge_ As Long, j As Long, Rng2 As Range
Dim ScrewSzorzo_ As Long, NutSzorzo_ As Long, HingeSzorzo_ As Long
Set Rng = Range("h2:h3")
Set Rng2 = ActiveSheet.UsedRange
If Not Intersect(Target, Rng) Is Nothing Then
For i = 2 To Rng2.Rows.Count
Select Case Target.Offset(0, -2) 'Rng2.Cells(i, 6)
Case "Product01"
ScrewSzorzo_ = 5 'change if necessary
NutSzorzo_ = 2 'change if necessary
HingeSzorzo_ = 1 'change if necessary
Case "Product02"
ScrewSzorzo_ = 4 'change if necessary
NutSzorzo_ = 3 'change if necessary
HingeSzorzo_ = 2 'change if necessary
End Select
Next i
j = Target.Value
Screw_ = ScrewSzorzo_ * j
Nut_ = NutSzorzo_ * j
Hinge_ = HingeSzorzo_ * j
For i = 2 To Rng2.Rows.Count
Select Case Rng2.Cells(i, 1)
Case "Screw"
Rng2.Cells(i, 3) = Rng2.Cells(i, 3) - Screw_
Case "Nut"
Rng2.Cells(i, 3) = Rng2.Cells(i, 3) - Nut_
Case "Hinge"
Rng2.Cells(i, 3) = Rng2.Cells(i, 3) - Hinge_
End Select
Next i
End If
End Sub