following macro should do the job for you.

In the beginning of the macro, the variables Source and Dest are assigned to "sheet1" and "sheet2", you'll have to enter the worksheet names of your choice in there.

Sub TransformSheet()

Dim Source As Worksheet, Dest As Worksheet

Dim i As Integer, NuLi As Integer, EndBlock As Integer

Dim j As Integer, k As Integer, Thick As Double

Set Source = Sheets("sheet1")

Set Dest = Sheets("sheet2")

NuLi = Source.Cells(1, 1).SpecialCells(xlCellType

j = 1

i = 1

While i <= NuLi

If Source.Cells(i, 1) <> "" Then

EndBlock = Source.Cells(i, 1).End(xlDown).Row

Dest.Cells(j, 1) = Source.Cells(i, 1)

j = j + 1

Start = j

With Source

For k = i + 1 To EndBlock

If .Cells(k, 2) = .Cells(k + 1, 2) And .Cells(k, 3) = .Cells(k + 1, 3) And .Cells(k, 4) = .Cells(k + 1, 4) Then

Thick = .Cells(k, 1) + Thick

Else

Thick = .Cells(k, 1) + Thick

Dest.Cells(j, 1) = Thick

Dest.Cells(j, 2) = .Cells(k, 2)

Dest.Cells(j, 3) = .Cells(k, 3)

Dest.Cells(j, 4) = .Cells(k, 4)

Thick = 0

j = j + 1

End If

Next k

Dest.Cells(Start, 6).Formula = "=Sum($A$" & Start & ":$A$" & j - 1 & ")"

End With

i = EndBlock + 1

Else

i = i + 1

End If

Wend

End Sub

Have Fun

Calacuccia

PS If you need more explanation, just shout