ibrahimo00o,
Actually, there's a flaw in my code. Try the following instead..
Code:
[font=Verdana][color=darkblue]Option[/color] [color=darkblue]Explicit[/color]
[color=darkblue]Sub[/color] test()
[color=darkblue]Dim[/color] LastRow [color=darkblue]As[/color] [color=darkblue]Long[/color]
[color=darkblue]Dim[/color] i [color=darkblue]As[/color] [color=darkblue]Long[/color]
Application.ScreenUpdating = [color=darkblue]False[/color]
LastRow = Cells(Rows.Count, "A").End(xlUp).Row
[color=darkblue]For[/color] i = LastRow [color=darkblue]To[/color] 2 [color=darkblue]Step[/color] -1
[color=darkblue]If[/color] Sgn(Cells(i, "A")) = Sgn(Cells(i - 1, "A")) [color=darkblue]Then[/color]
Cells(i - 1, "A").Value = Cells(i - 1, "A").Value + Cells(i, "A").Value
Rows(i).Delete
[color=darkblue]End[/color] [color=darkblue]If[/color]
[color=darkblue]Next[/color] i
Application.ScreenUpdating = [color=darkblue]True[/color]
[color=darkblue]End[/color] [color=darkblue]Sub[/color]
[/font]
pgc01,
Good point... Based on your example, my macro will return the following results...
2
0
4
0
-6
3
0
If this is not the desired result, the code will need to be amended.