Option Explicit
Sub TEST1()
Dim ar, i&, j&
ar = [A1].CurrentRegion: ar(1, 1) = "合并"
ReDim Preserve ar(1 To UBound(ar), 1 To UBound(ar, 2) + 2)
For i = 2 To UBound(ar)
ar(i, UBound(ar, 2)) = ar(i, 5)
ar(i, 5) = ar(i, 4)
ar(i, 4) = 0
For j = 2 To 5
ar(i, j) = Format(ar(i, j), "0.000")
Next j
ar(i, UBound(ar, 2)) = """" & ar(i, UBound(ar, 2)) & """ """" """""
ar(i, UBound(ar, 2) - 1) = "NONE 0 0 0 0 4518 0"
ar(i, 1) = Join(Application.Index(ar, i))
Next i
Columns("L").Clear
[L4].Resize(UBound(ar)) = ar
Beep
End Sub |