Sub AddColumnsHandJ()
Dim tot1 as Long, tot2 as Long
Dim i as long
tot1 = 0 : tot2 = 0
for i = 5 to cells(rows.count,1).End(xlup).Row
tot1 = tot1 + cells(i,"H").Value
tot2 = tot2 + cells(i,"J").Value
if cells(i,"A").Value < cells(i+1,"A").Value or _
cells(i,"B").Value < cells(i+1,"B").Value or _
cells(i,"D").Value < cells(i+1,"D").Value then
cells(i,"I").Value = tot1
cells(i,"K").Value = tot2
tot1 = 0 : tot2 = 0
end if
Next
End Sub
--
Regards,
Tom Ogilvy
"Priyanga Fernando" wrote in message
...
Hello Mr Ogilvy,
I'm sorry I completely miss understood.
Data starts at 5th Row.
Regards,
Fernando
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!