- ©«¤l
- 1446
- ¥DÃD
- 40
- ºëµØ
- 0
- ¿n¤À
- 1470
- ÂI¦W
- 0
- §@·~¨t²Î
- Windows 7
- ³nÅ骩¥»
- Excel 2010 & 2016
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW
- µù¥U®É¶¡
- 2020-7-15
- ³Ì«áµn¿ý
- 2024-11-28
|
¦^´_ 1# m06o2
ÁÂÁ«e½úµoªí¦¹¥DÃD»P½d¨Ò
«á¾ÇÂǦ¹©«½m²ß°}¦C»P¦r¨å,¾Ç²ß¤è®×¦p¤U,½Ð«e½ú°Ñ¦Ò
´ú¸Õ_20230921_1.zip (64.17 KB)
¸ê®Æªí:
µ²ªGªí:
Option Explicit
Sub TEST()
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Dim Arr(1 To 16, 1 To 12), Brr, Crr, V, D, E, Z, Q, i&, j%, R&
Set Z = CreateObject("Scripting.Dictionary")
Brr = Range([Á`ªí!A4], [Á`ªí!O65536].End(3))
For i = 1 To UBound(Brr)
If Trim(Brr(i, 7)) <> "" And Brr(i, 15) = "" Then MsgBox "¸ê®Æ¤£§¹¾ã": Exit Sub
If Val(Brr(i, 15)) > 0 Then
For j = 1 To 9
If Trim(Brr(i, j)) = "" Then MsgBox "¸ê®Æ¤£§¹¾ã": Exit Sub
Next
End If
Next
D = Array(1, 2, 3, 7, 11, 12)
E = Split("2,4,6,8,9,15", ",")
For i = 1 To UBound(Brr)
V = Z(Brr(i, 7))
If Not IsArray(V) Then V = Arr
R = Z(Brr(i, 7) & "|R") + 1: Z(Brr(i, 7) & "|R") = R
For j = 0 To UBound(D): V(R, D(j)) = Brr(i, E(j)): Next
Z(Brr(i, 7)) = V
Next
Crr = Range([»²§Uªí!C1], [»²§Uªí!A65536].End(3))
For i = 1 To UBound(Crr): Z(Crr(i, 1) & "|") = i: Next
For i = Sheets.Count To 1 Step -1
If InStr(Sheets(i).Name, ".") Then Sheets(i).Delete
Next
For Each Q In Z.KEYS
If Not IsArray(Z(Q)) Then GoTo Q01
With Sheets("¦C¦L").Copy(after:=Worksheets(Sheets.Count))
R = Z(Q & "|R"): ActiveSheet.Name = Q & "."
[B3] = Q: [B4] = Crr(Z(Q & "|"), 2): [B5] = Crr(Z(Q & "|"), 3)
With [A9].Resize(R, 12)
.Value = Z(Q): .Borders.LineStyle = 1
.Item(.Count + 11) = "Á`p:": .Item(.Count + 11).Font.Bold = True
.Item(.Count + 12) = "=SUM(L9:L" & 8 + R & ")"
.Item(.Count + 12).Font.Bold = True
With Range(.Item(.Count + 25), [L27])
.Merge: .Value = "³Æµù:"
.HorizontalAlignment = xlLeft
.VerticalAlignment = xlTop
.Borders.LineStyle = 1
End With
End With
End With
Q01: Next
Set Z = Nothing: Erase Arr, Brr, Crr
End Sub |
|