代码仅供参考
- Sub 测试() ''答题专用套路--by:学习使我快乐
- Dim i, j, k, m, n, 累计时间, 累计结果
- Sheet1.Activate
- n = Cells(Rows.Count, "A").End(xlUp).Row
- For i = 2 To n
- If i = n Then
- Cells(i, 3) = (Cells(i, 1) - Cells(i - 1, 1)) * 24
- End If
- If i > 2 And i < n Then
- Cells(i, 3) = (Cells(i + 1, 1) - Cells(i - 1, 1)) * 24
- ElseIf i = 2 Then
- Cells(i, 3) = (Cells(i + 1, 1) - Cells(i, 1)) * 24
- End If
- Cells(i, 4) = Cells(i, 3) * Cells(i, 2)
- 累计时间 = 累计时间 + Cells(i, 3)
- 累计结果 = 累计结果 + Cells(i, 4)
- Next
- Cells(n + 1, 3) = "结果"
- Cells(n + 1, 4) = 累计结果 / 累计时间 * 累计时间 / 2 * 0.36 / 10000
- End Sub
复制代码 |