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

§Ö³t¤ñ¹ï¯x°}¤ºªº¸ê®Æ¤j¤p!!

§Ö³t¤ñ¹ï¯x°}¤ºªº¸ê®Æ¤j¤p!!

·Q½Ð°Ý¤j®a
°²¦p¦³­Ó°ÊºA¯x°}¡A¤º³¡¸ê®ÆÄ´¦p
A, 1
B, 6
A, 100
C, 90
B, 99
D, 1
A, 50
......
¤£ª¾¹D­n°µ¡A¤~¯àÅýVBA§Ö³t¨ú±o­Ó§O¶µ¥Øªº³Ì¤j­È¹ïÀ³!
(100¬OAªº³Ì¤j­È, 99¬OBªº³Ì¤j­È)
·Q½Ð°Ý¤j®a¦³¨S¦³¤°»òµ´©Û
thank you!

¦^´_ 1# yenwang
¦pªG¥u­n§ä¨ä¤¤¤@­Ó³Ì¤j­È¡A¤@­Ó°j°é¥[¤ñ¤j¤p´N¥i¥H¤F
°Ñ¦Ò¬Ý¬Ý!
  1. Sub °}¦C§ì³Ì¤j­È()
  2. Dim Arr, ViewMax
  3. Arr = Range("a1:b7")  '¤Þ¤J§Aªº°}¦C
  4. With CreateObject("Scripting.Dictionary")
  5.     For i = 1 To UBound(Arr)
  6.         If .Exists(Arr(i, 1)) Then
  7.             If .Item(Arr(i, 1)) < Arr(i, 2) Then .Item(Arr(i, 1)) = Arr(i, 2)
  8.         Else
  9.            .Add Arr(i, 1), Arr(i, 2)
  10.         End If
  11.     Next i
  12.     For Each ViewMax In .Keys
  13.         Debug.Print ViewMax, .Item(ViewMax)
  14.     Next
  15. End With
  16. End Sub
½Æ»s¥N½X

TOP

Sub AR1017()
Dim Arr, xD, j&, T, V
Set xD = CreateObject("Scripting.Dictionary")
Arr = Range([A1], [B65536].End(xlUp))
For j = 1 To UBound(Arr)
¡@¡@T = Arr(j, 1):¡@V = Arr(j, 2)
¡@¡@If xD(T) = "" Then xD(T) = V
¡@¡@If V > xD(T) Then xD(T) = V
Next j
[E1:F1].Resize(xD.Count) = Application.Transpose(Array(xD.keys, xD.items))
End Sub

TOP

http://blog.xuite.net/hcm19522/twblog/350193923

TOP

        ÀR«ä¦Û¦b : ¦³Ä@©ñ¦b¤ß¸Ì¡A¨S¦³¨­Åé¤O¦æ¡A¥¿¦p¯Ñ¥Ð¤£¼½ºØ¡A¬Ò¬OªÅ¹L¦]½t¡C
ªð¦^¦Cªí ¤W¤@¥DÃD