Excel 2000 Formula or Macro
Option Explicit
Private prev As Variant
Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "A:A" '<== change to suit
On Error GoTo ws_exit
Application.EnableEvents = False
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
If .Value < prev Then .Offset(0, 1).Value = _
.Offset(0, 1).Value + (prev - .Value)
End With
End If
ws_exit:
Application.EnableEvents = True
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
prev = Target.Value
End Sub
'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.
--
HTH
Bob
(there's no email, no snail mail, but somewhere should be gmail in my addy)
"craigtab" wrote in message
...
I want to be able to add what ever number has been subtracted from one
colum
to another colum.
Example: colum A colum B
210 25
200 35
190 45
250 45
230 65
200 95
When I change the number in colum A to a lower number. I want
it to automatically add to colum B. But if I add to colum A, I want
nothing
to happen.
Colum A is our in stock amount. Colum B is total used or
sold.
This is probably a simple thing to do, but so far I have not found the
formula, or macro to do it.
I Thank You for any Help you may tell me.
Thank You,
Craig Alan Johnson Sr.
|