¥»©«³Ì«á¥Ñ PKKO ©ó 2015-10-6 15:43 ½s¿è
·Q½Ð°Ý¦U¦ì¤j¤j,§ÚSet xd2 = CreateObject("Scripting.Dictionary")
µM«á¤U¤è¶]¦^°é¥i¥H±o¨ì¨âÓªF¦è
1:¤£«½Æªº¦WºÙxd.keys,2:¨CÓ¦WºÙ¥X²{¹Lªº¦¸¼Æ
°ÝÃD¬O§Ún¦p¦ó±o¨ì«e¤T¦W¥X²{¹Lªº¦¸¼Æ¬O´X¦¸?¥H¤Î³o«e¤T¦W¬O½Ö?- '¿é¤J¦¸¼Æ
- for °j°é
- xd2(CInt(ar(j))) = xd2(CInt(ar(j))) + 1
- next
½Æ»s¥N½X ¤p§Ì¼g±o¥X¨Ó,¦ý¤èªk«Ü·M¬N,·Q½Ð±Ð¦U¦ì¤j¤j¤@©w¦³§ó¦nªº°µªk
¥H¤U¬°¤p§Ìªºµ{¦¡½X(Ãlªø·V¤J!)
§Ú¬O¥ý±NitemsÂର¥t¤@Ó°}¦C,¦b¥Î°}¦C¶i¦æ±Æ§Ç¤j¤p,µM«á¦A¶]¦^°é¦pªG¦¸¼Æ¬Ûµ¥,´N§â¦WºÙ¨ú¥X,ªÖ©w¦³§ó²©öªº¤èªk,¦]¦¹·Q°Ý°Ý¬Ý¦U¦ì¤j¤jªº¼¶¼g¤èªk!- '§ä¥X³Ì¤jªº¤TÓ¦¸¼Æ
- aar = Split(Join(xd2.items, ","), ",")
- ReDim cc(0 To UBound(aar), 1 To 1)
- For j = 0 To UBound(aar)
- cc(j, 1) = CInt(aar(j))
- Next
- a1 = 0: a2 = 0: a3 = 0
- For j = 0 To UBound(aar)
- If a1 = 0 Then a1 = Application.WorksheetFunction.Large(cc, j + 1)
- If Application.WorksheetFunction.Large(cc, j + 1) <> a1 And a2 = 0 Then
- a2 = Application.WorksheetFunction.Large(cc, j + 1)
- End If
- If Application.WorksheetFunction.Large(cc, j + 1) <> a1 And Application.WorksheetFunction.Large(cc, j + 1) <> a2 And a3 = 0 Then
- a3 = Application.WorksheetFunction.Large(cc, j + 1)
- End If
- Next
- str1 = a1 & "¦¸:": str2 = a2 & "¦¸:": str3 = a3 & "¦¸:"
- For Each e In xd2.keys
- If xd2(CInt(e)) = a1 Then str1 = str1 & CInt(e) & ","
- If xd2(CInt(e)) = a2 Then str2 = str2 & CInt(e) & ","
- If xd2(CInt(e)) = a3 Then str3 = str3 & CInt(e) & ","
- Next
- If a1 <> 0 Then str1 = Left(str1, Len(str1) - 1)
- If a2 <> 0 Then str2 = Left(str2, Len(str2) - 1)
- If a3 <> 0 Then str3 = Left(str3, Len(str3) - 1)
½Æ»s¥N½X |