Public Sub format1()
Dim ar, br(1 To 60000, 1 To 9), i, j, arr, t, k, n
'maxrow1 = Cells(Rows.Count, "B").End(xlUp).Row
Columns("E:E").Select
' Range("E2").Activate
Selection.Replace What:="~*", Replacement:="×", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Columns("E:E").Select
' Range("E2").Activate
Selection.Replace What:="X", Replacement:="×", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ar = Range("a3", [f65536].End(3))
For i = 1 To UBound(ar)
arr = Split(ar(i, 5), "×")
'If UBound(arr) - LBound(arr) + 1 > 2 Then ReDim Preserve arr(LBound(arr) To UBound(arr) - 1)
ReDim Preserve arr(LBound(arr) To UBound(arr) - 1)
t = Evaluate(Join(arr, "*"))
n = n + t
'For j = n To n - Val(ar(i, 5)) + 1 Step -1
For j = n To n - t + 1 Step -1
k = k + 1
If j = n - t + 1 Then
br(j, 1) = ar(i, 1)
br(j, 2) = ar(i, 2)
br(j, 3) = ar(i, 3)
br(j, 4) = ar(i, 4)
br(j, 5) = ar(i, 5)
br(j, 9) = ar(i, 6)
End If
br(j, 6) = t - k + 1
Next j
k = 0
Next
With Sheets(1)
.Rows("3:" & .Rows.Count).Clear
With .[a3].Resize(n, 9)
.Value = br
.Font.Size = 9
.Resize(, 10).Borders.LineStyle = xlContinuous
End With
End With
End Sub
若点击调试的话会提出 t = Evaluate(Join(arr, "*"))这个语句有问题,请大神指导
慕妹3146593
动漫人物