Sub chendong()
On Error Resume Next
Dim dulieu, kq()
Dim dong, cot, i, j, a
dulieu = Range([a4], [a65536].End(3)).Resize(, 4).Value
ReDim kq(1 To UBound(dulieu) * 10, 1 To 4)
For dong = 1 To UBound(dulieu) * 10 Step 10
j = j + 1
For cot = 1 To 2
kq(dong, cot) = dulieu(j, cot)
Next
a = Round((dulieu(j + 1, 2) - dulieu(j, 2)) / 10, 1)
For i = 2 To 10
kq(dong + i - 1, 2) = kq(dong + i - 2, 2) + a
kq(dong + i - 1, 3) = a
kq(dong + 9, 4) = kq(dong + 9, 2) + kq(dong + 9, 3)
Next
Next
[a4].Resize(dong - 1, 4) = kq
End Sub