|
- Sub lqxs()
- Dim Arr, i&, Sht As Worksheet, nm$, nm1$, m&, n&
- Dim d, k, t, j&, y&
- Application.ScreenUpdating = False
- Set d = CreateObject("Scripting.Dictionary")
- nm = ThisWorkbook.Name
- Sheets("明细-Dec").Activate
- Arr = [c5].CurrentRegion
- For i = 3 To UBound(Arr) - 1
- d(Arr(i, 1)) = i + 4
- Next
- k = d.keys: t = d.items
- For i = 0 To UBound(k)
- nm1 = k(i) & "-" & nm
- Sheets(Array("明细-Dec", "明细-Q3")).Copy
- With ActiveWorkbook
- For Each Sht In .Sheets
- With Sht
- .Activate
- .[c2] = k(i) & "-" & .[c2].Value
- For j = 0 To UBound(t)
- If i <> j Then
- m = t(j): n = m + 14
- For y = 5 To 50 Step 9
- .Cells(m, y).Resize(1, 3) = ""
- .Cells(m, y + 7) = ""
- .Cells(n, y).Resize(1, 3) = ""
- .Cells(n, y + 7) = ""
- Next
- End If
- Next
- End With
- Next
- .SaveAs ThisWorkbook.Path & "" & nm1
- .Close
- End With
- Next
- Application.ScreenUpdating = True
- End Sub
复制代码 |
|