Forum Discussion
MM84
Mar 26, 2025Copper Contributor
Help with a changing qty on hand formula
I'm having a hard time getting a formula to work. I have 3 columns, one is Qty on Hand, the next they would like to add to the qty on hand and the third column to subtract from the qty on hand. I ne...
HansVogelaar
Apr 02, 2025MVP
This is what the sheet looks like:
And this is the code behind the worksheet:
Private Sub Worksheet_Change(ByVal Target As Range)
Application.ScreenUpdating = False
Application.EnableEvents = False
If Not Intersect(Range("B2"), Target) Is Nothing Then
Range("A2").Value = Range("A2").Value + Val(Range("B2").Value)
End If
If Not Intersect(Range("C2"), Target) Is Nothing Then
Range("A2").Value = Range("A2").Value - Val(Range("C2").Value)
End If
Application.EnableEvents = True
Application.ScreenUpdating = True
End Sub
MM84
Apr 02, 2025Copper Contributor
thank you so very much, I will give this a try!!! I sincerely appreciate all your help!!!