- ©«¤l
- 4901
- ¥DÃD
- 44
- ºëµØ
- 24
- ¿n¤À
- 4916
- ÂI¦W
- 244
- §@·~¨t²Î
- Windows 7
- ³nÅ骩¥»
- Office 20xx
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥x¥_
- µù¥U®É¶¡
- 2010-4-30
- ³Ì«áµn¿ý
- 2024-11-10
|
- Sub Ex()
- Dim Sht(), Rng As Range, Ar(), A As Range
- Set d = CreateObject("Scripting.Dictionary")
- Set d1 = CreateObject("Scripting.Dictionary")
- For Each sh In Sheets
- ReDim Preserve Sht(s)
- Sht(s) = sh.Name
- s = s + 1
- Next
- With ¤u§@ªí1
- Set Rng = .[B2:O3]
- For Each A In .Range(.[D5], .[D5].End(xlDown))
- d1(A.Value) = d1(A.Value) + 1
- If IsEmpty(d(A.Value)) Then
- ReDim Preserve Ar(0)
- Ar(0) = Array(d1(A.Value), A.Offset(, -1).Value, A.Value, A.Offset(, 1).Value, A.Offset(, 2).Value, A.Offset(, 3).Value, A.Offset(, 4).Value, A.Offset(, 5).Value, A.Offset(, 6).Value, A.Offset(, 7).Value, A.Offset(, 8).Value, A.Offset(, 9).Value, A.Offset(, 10).Value, A.Offset(, 11).Value)
- d(A.Value) = Ar
- Else
- Ar = d(A.Value)
- k = UBound(Ar)
- ReDim Preserve Ar(k + 1)
- Ar(k + 1) = Array(d1(A.Value), A.Offset(, -1).Value, A.Value, A.Offset(, 1).Value, A.Offset(, 2).Value, A.Offset(, 3).Value, A.Offset(, 4).Value, A.Offset(, 5).Value, A.Offset(, 6).Value, A.Offset(, 7).Value, A.Offset(, 8).Value, A.Offset(, 9).Value, A.Offset(, 10).Value, A.Offset(, 11).Value)
- d(A.Value) = Ar
- End If
- Next
- End With
- For Each ky In d.keys
- If IsError(Application.Match(ky, Sht, 0)) Then
- With Worksheets.Add(after:=Sheets(Sheets.Count))
- .Name = ky
- End With
- End If
- With Sheets(ky)
- .Cells.Clear
- .[F:G].NumberFormat = "h:m"
- Rng.Copy .[B2]
- Ar = d(ky)
- With .[B4].Resize(UBound(d(ky)) + 1, 14)
- .Value = Application.Transpose(Application.Transpose(Ar))
- .Borders.LineStyle = 1
- End With
- End With
- Next
- End Sub
½Æ»s¥N½X ¦^´_ 1# b9208 |
|