here it is i want to if b5=closing then c5= "sum(c2:c4)-(e2:e4)"
correspontantly through all row eg: b8=closing c8=" sum(c2:c7)-(e2:e7)"
but should not be updated on previous (c5)
i created a macro with cell reference but when i add a row in the middle of this its not updating
VBA Code:
Private Sub worksheet_change(ByVal Target As Range)
If Target.CountLarge > 1 Then Exit Sub
If Target.Value = "closing" Then Target.Offset(1, 0).Value = "opening"
Range("h2").Copy
If Target.Value = "closing" Then Target.Offset(0, 1).PasteSpecial Paste:=xlPasteValues
If Target.Value = "closing" Then Target.Offset(1, 1).PasteSpecial Paste:=xlPasteValues
End Sub
additional information H2=sum(d2:d10000)-sum(e2:e10000)