Collectionª«¥ó¨Ï¥ÎªººÃ´b¡H
- ©«¤l
- 231
- ¥DÃD
- 55
- ºëµØ
- 0
- ¿n¤À
- 293
- ÂI¦W
- 0
- §@·~¨t²Î
- winxp
- ³nÅ骩¥»
- office2003
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- ¨Ó¦Û
- KEELUNG
- µù¥U®É¶¡
- 2010-7-24
- ³Ì«áµn¿ý
- 2018-8-28
|
Collectionª«¥ó¨Ï¥ÎªººÃ´b¡H
¥»©«³Ì«á¥Ñ dechiuan999 ©ó 2014-1-21 07:10 ½s¿è
¦U¦ì¤j¤j¦n¡G
¤p§Ì¹ïCollectionª«¥óªºÀ³¥Î¡A
¤´µLªk§¹¥þ²z¸Ñ¡C
¤p§Ì¥Ñ®Ñ¤¤ªº½d¨Ò´N¦³¤@°ÝÃD
·Q½Ð敎¦U¦ì¤j¤j¡C
½d¨Ò¦p¤U¡G
Sub aa()
'´ú¸Õ¸ê®Æ E_Data01ªí
Dim myAr As Variant
Dim myCnt As Long
Dim myClc As New Collection
Dim myKey As String
Dim myErrNum As Long
Dim i As Long
Dim mStr1$, mStr2$
myAr = Range("A1").CurrentRegion.Value '«ü©w·j´M¨Ó·½½d³ò
For i = 1 To UBound(myAr)
'myClc.Add Item:=myAr(i, 8), key:=CStr(myAr(i, 3))
myClc.Add Item:=myAr(i, 8) & "_" & myAr(i, 3), key:=CStr(myAr(i, 3)) '¦pªG§ïÅÜItemªº¤º®e¬°¦ó´NµLªk«ü¥XkeyÈ©O¡H
Next
For i = 1 To myClc.Count
mStr1 = myClc.Item(i)
Next
myKey = "´çÃä" '«ü©wKEY
On Error Resume Next
myCnt = myClc.Item(myKey) '¦pªGitem§ïÅܮɡAmyCntªºÈ´NµLªk¨ú±o¡C
'myCnt = myClc(myKey)
myErrNum = Err.Number
On Error GoTo 0
If myErrNum = 0 Then
MsgBox myKey & "ªº¦Xp¤À¼Æ¬°" & myCnt & "¡C"
Else
MsgBox "¨S¦³§ä¨ì²Å¦X±ø¥óªº¸ê®Æ"
End If
Set myClc = Nothing 'ª«¥óªºÄÀ©ñ
End Sub
¦bmyClc.add®É¡A§ïÅÜItemªºÈ¡F¦Ó¤´¤£§ïÅÜkeyȤ§«á¡A´NµLªk±o¨ìmyCntªºÈ©O¡H
'myClc.Add Item:=myAr(i, 8), key:=CStr(myAr(i, 3))
myClc.Add Item:=myAr(i, 8) & "_" & myAr(i, 3), key:=CStr(myAr(i, 3)) '¦pªG§ïÅÜitemªº¤º®e¬°¦ó´NµLªk«ü¥XkeyÈ©O¡H
test1.rar (7.97 KB)
ÁÂÁ¦U¦ì¤j¤j¡I |
|
|
|
|
|
|
- ©«¤l
- 231
- ¥DÃD
- 55
- ºëµØ
- 0
- ¿n¤À
- 293
- ÂI¦W
- 0
- §@·~¨t²Î
- winxp
- ³nÅ骩¥»
- office2003
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- ¨Ó¦Û
- KEELUNG
- µù¥U®É¶¡
- 2010-7-24
- ³Ì«áµn¿ý
- 2018-8-28
|
¦^´_ 2# GBKEE
ÁÂÁªO¥D¤j¤j¡C
À°¤p§Ì¸Ñ¶}´e¦b¤ß¤¤ªººÃ´b¡C
¦P®É¡A§ó´£¥X¨ú¥XCollection item
½Ñ¦h¤èªk¡C
ÁÂÁªO¥D¤j¤j¡C
·P®¦¤j¤j¡I |
|
|
|
|
|
|