|
- Sub test()
- Dim r%, i%
- Dim ws As Worksheet
- Dim arr, brr
- Application.ScreenUpdating = False
- Application.DisplayAlerts = False
- For Each ws In Worksheets
- If ws.Name Like "#*" Then
- ws.Delete
- End If
- Next
- With Worksheets("淘汰赛")
- r = .Cells(.Rows.Count, 1).End(xlUp).Row
- c = .Cells(3, .Columns.Count).End(xlToLeft).Column
- arr = .Range("a3").Resize(r - 2, c)
- End With
-
- For i = 2 To UBound(arr) Step 2
- For j = 4 To UBound(arr, 2) Step 3
- If Len(arr(i, j + 2)) <> 0 Then
- Worksheets("空白").Copy after:=Worksheets(Worksheets.Count)
- With ActiveSheet
- .Name = CStr(arr(i, j + 2))
- .Range("ak3") = arr(i, j + 2)
- .Range("ao3") = arr(1, j)
- .Range("c5") = arr(1, j + 1)
- .Range("l5") = arr(i, j)
- .Range("x5") = arr(i + 1, j)
- .Range("l6") = arr(i, j + 1)
- .Range("x6") = arr(i + 1, j + 1)
- .Range("l7") = arr(i, 3)
- .Range("x7") = arr(i + 1, 3)
- .Range("o40") = arr(i + 1, j + 2)
- End With
- End If
- Next
- Next
-
- End Sub
复制代码 |
|