Por favor a ver si algien me puede decir por qué esta macro (que hace bien
su trabajo de totalizar el importe de una serie de elementos repetidos)
termina dando un error de desbordamiento en la fila que pone "suma = suma +
Cells(fila, 9)"
' sumar importes en el último elemento repetido
Dim fila As Integer
Dim suma As Integer
fila = 0
Do
suma = 0
Do
fila = fila + 1
If Cells(fila, 10) = Cells(fila + 1, 10) Then
suma = suma + Cells(fila, 9)
End If
Loop Until Cells(fila, 10) <> Cells(fila + 1, 10)
Cells(fila, 11).Value = suma + Cells(fila, 9).Value
Loop Until IsEmpty(Cells(fila, 1))
End Sub
Leer las respuestas