我想要一些技巧来更快地运行这个宏。我的数据范围很广,而且需要的时间太长。你们中的任何人都有加快速度的想法吗?
Sub GanadoAcumulado()
With ActiveSheet
LastRow = .Cells(.Rows.Count, "B").End(xlUp).Row
End With
Tganhado = 0: Tjogado = 0
For i = 1 To LastRow
If Range("R1").Offset(i, 0).Value = "" Then
a = Range("A1").Offset(i, 0).Value
b = Range("B1").Offset(i, 0).Value
c = Range("C1").Offset(i, 0).Value
For j = 1 To LastRow
If Range("A1").Offset(j, 0).Value = a And _
Range("B1").Offset(j, 0).Value = b And _
Range("C1").Offset(j, 0).Value = c Then
Tjogado = Tjogado + Range("J1").Offset(j, 0).Value
Tganhado = Tganhado + Range("P1").Offset(j, 0).Value
Range("R1").Offset(j, 0).Value = Tganhado
Range("S1").Offset(j, 0).Value = Tjogado
End If
Next j
End If
Tganhado = 0
Tjogado = 0
Next i
End Sub