[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] Cnt [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
Cnt = 1
[color=darkblue]For[/color] i = LastRow [color=darkblue]To[/color] 2 [color=darkblue]Step[/color] -1
[color=darkblue]If[/color] i = 2 [color=darkblue]Then[/color]
Cells(i, "B").Value = Cnt
[color=darkblue]ElseIf[/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
Cnt = Cnt + 1
Rows(i).Delete
[color=darkblue]Else[/color]
Cells(i, "B").Value = Cnt
Cnt = 1
[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]