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...
MM84
Mar 31, 2025Copper Contributor
I'm having issues at the moment trying to get this to open. Is there anyway you can type out the info? I'm sorry to ask, our system just keeps throwing security alert and I can't even get to allow macros to watch. my apologies
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
- MM84Apr 02, 2025Copper Contributor
thank you so very much, I will give this a try!!! I sincerely appreciate all your help!!!