Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Row <= 2 Then Exit Sub
c = Target.Column
r = Target.Row
If Cells(2, c) <> "Faulty Transfer" Then Exit Sub ' Check this if this "Faulty Transfer": EXIT if not
On Error GoTo ErrHandler
Application.EnableEvents = False
Cells(r, 8) = Cells(r, 8) + Target.Value 'Update "Faulty Warehouse" stock
Target.Offset(0, -1).Value = Target.Offset(0, -1).Value - Target.Value 'Reduce "Faulty" stock
Target.Value = 0 ' Reset "Faulty" to zero
ErrHandler:
Application.EnableEvents = True
End Sub
Bookmarks