- ©«¤l
- 2834
- ¥DÃD
- 10
- ºëµØ
- 0
- ¿n¤À
- 2890
- ÂI¦W
- 0
- §@·~¨t²Î
- ¡e²¤¡f
- ³nÅ骩¥»
- ¡e²¤¡f
- ¾\ŪÅv
- 100
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¡e²¤¡f
- µù¥U®É¶¡
- 2013-5-13
- ³Ì«áµn¿ý
- 2024-11-26
|
±Ä³vµ§¼g¤J, ³t«×¸ûºC:
Sub TEST()
Dim Sht As Worksheet, Arr, xD, i&, j%, T1$, T2$, U1&, U2&
Set Sht = ActiveSheet
Call §R°£¤ÀÃþ¤u§@ªí
Application.ScreenUpdating = False
Arr = Range([A1], Cells(Rows.Count, 1).End(xlUp))
Set xD = CreateObject("Scripting.Dictionary")
For i = 2 To UBound(Arr)
T1 = Split(Arr(i, 1), "-")(0): T2 = ""
For j = 1 To Len(T1)
If IsNumeric(Mid(T1, j, 1)) Then T2 = Left(T1, j - 1): Exit For
Next j
If T2 = "" Then GoTo 101
If xD(T2) = 0 Then '«Ø¥ß·s¤ÀÃþ¤u§@ªí
Sheets.Add(after:=Sheets(Sheets.Count)).Name = T2: Sht.Select: xD(T2) = 1
Sheets(T2).[A1:E1] = Array("½s¸¹", "¼Æ¶q", "", "Á`¼Æ¶q", "=sum(B:B)")
End If
U1 = xD(T1 & "-V"): U2 = xD(T2)
If U1 = 0 Then U2 = U2 + 1: U1 = U2: Sheets(T2).Cells(U1, 1) = T1 '·s¼W½s¸¹
Sheets(T2).Cells(U1, 2) = Sheets(T2).Cells(U1, 2) + 1 '²Öp¼Æ¶q
xD(T1 & "-V") = U1: xD(T2) = U2 'U1-[½s¸¹]ªº[¦C¦ì¸m], U2-[¤u§@ªí]³Ì«á¤@µ§[¦C¼Æ]
101: Next i
End Sub
Sub §R°£¤ÀÃþ¤u§@ªí()
Dim Sht As Worksheet
Application.DisplayAlerts = False
For Each Sht In Sheets
If Sht.Name <> ActiveSheet.Name Then Sht.Delete
Next
End Sub
Xl0000410.rar (24.38 KB)
=============================== |
|