still having a prob w/ my code
Posted by Jim on January 11, 2002 7:51 AM
Hi group,
I'm trying to subtract G51 by the amount entered in
G52 "only" if E52 matches E51 and I can accomplish this
w/ a commandbutton But I want this to work without
the commandbutton. I've tried Private Sub Worksheet_
Change(ByVal Target as Range) and it returns the value
i.e. if G51 has 100 in the cell and I enter 10 in cell
G52 i get -2,100 not the correct ans. "90"
My code below:
Private Sub Worksheet_Change(ByVal Target As Range)
If Range("E52") = Range ("E51") Then
Range("G51") = Range("G51") - Range("G52")
End If
End Sub
Any ideas would be appreciated
Jim