|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
Option Explicit
Sub TEST2()
Dim ar, br, i&, j&, r&, wks As Worksheet
Application.ScreenUpdating = False
For Each wks In Worksheets
If wks.Name <> "Sheet0" Then
With wks
r = .Cells(.Rows.Count, "B").End(xlUp).Row
ar = .Range("B1:D" & r).Value
ReDim br(1 To UBound(ar), 0)
For i = 1 To UBound(ar) Step 3
br(i + 1, 0) = ar(i, 3) - ar(i + 1, 3)
Next i
.[E1].Resize(UBound(br)) = br
End With
End If
Next
Application.ScreenUpdating = True
Beep
End Sub
|
|