- ©«¤l
- 2035
- ¥DÃD
- 24
- ºëµØ
- 0
- ¿n¤À
- 2031
- ÂI¦W
- 0
- §@·~¨t²Î
- Win7
- ³nÅ骩¥»
- Office2010
- ¾\ŪÅv
- 100
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2012-3-22
- ³Ì«áµn¿ý
- 2024-2-1
|
¦^´_ 9# ziv976688 - Sub Ex()
- Dim dic As Object, rng As Range, fld As Range, txt As String
-
- Set rng = Range("B2:H" & [H65536].End(xlUp).Row)
- Set dic = CreateObject("scripting.dictionary")
-
- [K:O].Clear
- For Each fld In rng
- txt = fld.Value
- If dic.exists(txt) = False Then
- dic(txt) = 1
- Else
- dic(txt) = dic(txt) + 1
- End If
- Next
-
- [K1] = " ¥Ñ¤p¦Ó¤j¨Ì§Ç±Æ¦C"
- [K2].Resize(UBound(dic.KEYS) + 1) = Application.Transpose(dic.KEYS) ' ¯Á¤ÞÈ´N¬O Keys
- [L2].Resize(UBound(dic.KEYS) + 1) = Application.Transpose(dic.Items) ' ¸ê®Æ¤º®e´N¬O Items
- With [K2].Resize(UBound(dic.KEYS) + 1, 2) ' Range("K2:L" & [L2].End(xlDown).Row)
- .Cells.Sort Key1:=.Cells(1), Order1:=xlAscending, Header:=xlNo ' xlDescending
- End With
-
- Range("K2:L" & [L65536].End(xlUp).Row).Copy [N2]
-
- [N1] = "¨Ì¥X²{¾÷²v¼Æ¾Ú±Æ¦C"
- With [N2].Resize(UBound(dic.KEYS) + 1, 2) ' Range("N2:O" & [O2].End(xlDown).Row)
- .Cells.Sort Key1:=.Cells(2), Order1:=xlDescending, Header:=xlNo ' xlAscending
- End With
- End Sub
½Æ»s¥N½X |
|