ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] ª«¥ó±Æ§Ç°ÝÃD"Scripting.Dictionary"

¦^´_ 1# PKKO
  1. Sub Test()
  2.     Dim xd2:  Set xd2 = CreateObject("Scripting.Dictionary")
  3. '    '¿é¤J¦¸¼Æ
  4. '    for °j°é
  5. '       xd2(CInt(ar(j))) = xd2(CInt(ar(j))) + 1
  6. '    Next
  7.    
  8.     Dim dicValue2Key: Set dicValue2Key = CreateObject("Scripting.Dictionary")
  9.     Dim xItem
  10.     For Each x In xd2.keys
  11.         xItem = xd2(x)
  12.         If Not dicValue2Key.exists(xItem) Then
  13.             dicValue2Key(xItem) = x
  14.         Else
  15.             dicValue2Key(xItem) = dicValue2Key(xItem) & "," & x
  16.         End If
  17.     Next
  18.    
  19.     Debug.Print "³Ì¦h¦¸: " & dicValue2Key(Application.WorksheetFunction.Large(dicValue2Key.keys, 1))
  20.     Debug.Print "²Ä¤G¦h¦¸: " & dicValue2Key(Application.WorksheetFunction.Large(dicValue2Key.keys, 2))
  21.     Debug.Print "²Ä¤T¦h¦¸: " & dicValue2Key(Application.WorksheetFunction.Large(dicValue2Key.keys, 3))
  22. End Sub
½Æ»s¥N½X
ªí¹F¤£²M¡BÃD·N¤£©ú½T¡B¨SªþÀɮ׮榡¡B¨S¦³°Q½×°ÝÃDªººA«×~~~~~~¥H¤W·R²ö¯à§U¡C

TOP

        ÀR«ä¦Û¦b : ¤Ó¶§¥ú¤j¡B¤÷¥À®¦¤j¡B§g¤l¶q¤j¡A¤p¤H®ð¤j¡C
ªð¦^¦Cªí ¤W¤@¥DÃD