Sub tot()
On Error Resume Next
r2 = 2
r = 2
outfile = "summary"
Sheets("checksat").Select
While Cells(r, 1) <> ""
kY = Cells(r, 2) & "." & Cells(r, 3) & "." & Cells(r, 5)
j = 0
j = Application.WorksheetFunction.Match(kY, Sheets(outfile).Range("a:a"), 0)
If j = 0 Then
j = r2
Sheets(outfile).Cells(r2, 1) = kY
Sheets(outfile).Cells(r2, 2) = Cells(r, 2)
Sheets(outfile).Cells(r2, 3) = Cells(r, 3)
Sheets(outfile).Cells(r2, 4) = Cells(r, 5)
r2 = r2 + 1
End If
Sheets(outfile).Cells(j, 5) = Sheets(outfile).Cells(j, 5) + Cells(r, 4)
r = r + 1
Wend
End Sub
Bookmarks