Te anexo la macro
Sub Totalizar()
'Por.Dante Amor
Set h1 = Sheets("Hoja1")
Set h2 = Sheets("Resumen")
'
h2.Rows("2:" & Rows.Count).ClearContents
j = 2
For i = 2 To h1.Range("A" & Rows.Count).End(xlUp).Row
cod = h1.Cells(i, "A").Value
Set b = h2.Columns("A").Find(cod, lookat:=xlWhole)
If Not b Is Nothing Then
fila = b.Row
Else
fila = j
h2.Cells(fila, "A") = cod
j = j + 1
End If
h2.Cells(fila, "E") = h2.Cells(fila, "E") + h1.Cells(i, "E")
h2.Cells(fila, "G") = h2.Cells(fila, "G") + h1.Cells(i, "G")
h2.Cells(fila, "I") = h2.Cells(fila, "I") + h1.Cells(i, "I")
h2.Cells(fila, "K") = h2.Cells(fila, "K") + h1.Cells(i, "K")
h2.Cells(fila, "Y") = h2.Cells(fila, "E") + h2.Cells(fila, "G") + _
h2.Cells(fila, "I") + h2.Cells(fila, "K")
Next
h2.Cells(j, "A") = "GRAN TOTAL"
h2.Cells(j, "E") = WorksheetFunction.Sum(h2.Range("E2:E" & j - 1))
h2.Cells(j, "G") = WorksheetFunction.Sum(h2.Range("G2:G" & j - 1))
h2.Cells(j, "I") = WorksheetFunction.Sum(h2.Range("I2:I" & j - 1))
h2.Cells(j, "K") = WorksheetFunction.Sum(h2.Range("K2:K" & j - 1))
h2.Cells(j, "Y") = WorksheetFunction.Sum(h2.Range("Y2:Y" & j - 1))
MsgBox "Fin"
End Sub
.
'S aludos. Dante Amor. Recuerda valorar la respuesta. G racias
.