- Sub test()
- Dim i, r, arr, sa
- Application.ScreenUpdating = False
- With Sheets("目录")
- r = .Cells(.Rows.Count, 1).End(xlUp).Row
- arr = .Range("A3:U" & r)
- End With
- sa = Array("C2", "E2", "C3", "E3", "C4", "C5", "E5", "G5", "C6", "E6", _
- "C7", "E7", "C8", "E8", "G8", "C9", "E9", "G9", "C10", "C11", "C12")
- For i = 1 To UBound(arr)
- Sheets("模板").Copy after:=Sheets(Sheets.Count)
- Sheets(Sheets.Count).Name = arr(i, 6)
- Sheets(Sheets.Count).Activate
- For j = 0 To 20
- Range(sa(j)) = arr(i, j + 1)
- Next
- Next
- Application.ScreenUpdating = True
- End Sub
复制代码 |