°}¦Cª«¥óArrayList »P°}¦CArray²V·f °ÝÃD
- ©«¤l
- 354
- ¥DÃD
- 5
- ºëµØ
- 0
- ¿n¤À
- 387
- ÂI¦W
- 0
- §@·~¨t²Î
- windows7
- ³nÅ骩¥»
- vba,vb,excel2007
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2017-1-8
- ³Ì«áµn¿ý
- 2024-8-2
|
°}¦Cª«¥óArrayList »P°}¦CArray²V·f °ÝÃD
|
|
|
|
|
|
- ©«¤l
- 354
- ¥DÃD
- 5
- ºëµØ
- 0
- ¿n¤À
- 387
- ÂI¦W
- 0
- §@·~¨t²Î
- windows7
- ³nÅ骩¥»
- vba,vb,excel2007
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2017-1-8
- ³Ì«áµn¿ý
- 2024-8-2
|
¦^´_ 1# singo1232001
¦Û°Ý¦Ûµª §ä¨ìµª®×¤F
¨Ó·½https://www.snb-vba.eu/VBA_Arraylist_en.html |
|
|
|
|
|
|
- ©«¤l
- 354
- ¥DÃD
- 5
- ºëµØ
- 0
- ¿n¤À
- 387
- ÂI¦W
- 0
- §@·~¨t²Î
- windows7
- ³nÅ骩¥»
- vba,vb,excel2007
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2017-1-8
- ³Ì«áµn¿ý
- 2024-8-2
|
¦^´_ 2# singo1232001
Ä~Äò°l¥[°ÝÃD¤@¤U
ºÊ¬Ý¾¹¤Þ¥Î ¥~³¡ª«¥ó ±`±`²§±`
´£°Ý ³o¬Obug¶Ü?
¦]¬°¤£¦n¤å¦r±Ôz ÁÙ¬O½Ð¬Ý¼v¤ù¤ñ¸û§Ö
¥Dn¬OºÊ¬Ý¦¡ª«¥ó¥Ã»·¥X²{·N·Q¤£¨ìªº²{¶H
https://www.youtube.com/watch?v=MlxAzvK0jrk |
|
|
|
|
|
|
- ©«¤l
- 319
- ¥DÃD
- 6
- ºëµØ
- 0
- ¿n¤À
- 309
- ÂI¦W
- 0
- §@·~¨t²Î
- xp
- ³nÅ骩¥»
- 2k
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2015-6-24
- ³Ì«áµn¿ý
- 2024-4-27
|
¦^´_ singo1232001
¦Û°Ý¦Ûµª §ä¨ìµª®×¤F
singo1232001 µoªí©ó 2022-2-11 02:35
§A½T©w¦³§ä¨ìµª®×?
2ºûªºÁÙ¬OµLªkקïȧr |
|
|
|
|
|
|
- ©«¤l
- 354
- ¥DÃD
- 5
- ºëµØ
- 0
- ¿n¤À
- 387
- ÂI¦W
- 0
- §@·~¨t²Î
- windows7
- ³nÅ骩¥»
- vba,vb,excel2007
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2017-1-8
- ³Ì«áµn¿ý
- 2024-8-2
|
¥»©«³Ì«á¥Ñ singo1232001 ©ó 2022-2-12 03:10 ½s¿è
¦^´_ 4# jackyq
¦³§ä¨ì¤@¨Çµïµ·°¨¸ñ
1.¨Ï¥Îarraylist®É ºÊ¬Ý¦¡®e©ö²§±` ¤£¯à¤Ó¹L¬Û«H ¦]¬°¬O¤Þ¥Î¥~³¡(.Net framework)ªºDLL «DVBA¦Û±a (¤W±§Ú¦³¶Ç¼v¤ù)
2.¥un¦Aarraylist°}¦C¤§«á ©ÎªÌ³QarrayList¥]¦í ©³¤U´N¨S¦³vba°}¦C ©³¤Uªºvba°}¦C·|³Q¦Û°Ê§ï¦¨arraylist°}¦C
3.¦p¤Wz ¦Ó¦barraylist°}¦C¤§«eªºVBA°}¦C ¤£¨ü¼vÅT ¤]´N¬O VBA°}¦C¯à¥]¦íarraylist°}¦C ¦ýarraylist°}¦C¤£¯à¥]vba°}¦C ¹ê»Ú¾Þ§@®É³Qarraylist¥]¦íªºvba°}¦C·|³Q±j¨î§ï¦¨arraylist°}¦C
4.ºÊ¬Ý¬d¸ßarraylist®É ¥i¥H¥Îar.item(0) ©ÎªÌar(0)ªº¤è¦¡¬d¸ß ¤]¥i¥H¿é¤J ¦ý«e´£¬O¦³add¤@Ó¦ì¸m
5.ªÅ¥ÕªºarraylistµLªk¹³dctionary(¦r¨å)ª½±µ³sÄò´O®Marraylist Yn´O®M ¥²¶·¦b´O®M«e ·s¼W ar.add "" ¤@Ó¦û¦ì¥Îªº¦ì¸m ¤~¥i¥H§Q¥Î³oÓ¦ì¸m¨Ó«·s Set ar(0) = CreateObject("System.Collections.ArrayList")
6.¦p¤Wz «Ü³Â·Ð«ç»ò¿ì,³o®ÉÔ¥i¥H§Q¥Î²Ä2ÂIªº³W«h ¥ý³Ð¤@Ó§A·QnªºvbaªºNºû°}¦C
¤ñ¦p
Dim br(3, 3, 3) ©ÎªÌ redim br(3, 3, 3)
Set ar= CreateObject("System.Collections.ArrayList")
ar.Add ""
ar.Add br
´N¥i¥Hª½±µ³Ð³y§A·Qnªº´O®M°}¦C
»P¦r¨å¤£¦Pªº±¡ªp¬O ¦r¨å¦L¶H¤¤¤£·|§âvba°}¦CÅܦ¨arraylist°}¦C
(¦ý³oºØ¤è¦¡ ¤£ºÞ«ç»ò¹Á¸Õ³Ì«á¦n¹³¥¢±Ñ¤F ÁöµM°}¦C¬[ºc¤]¦³¥X²{. ¦Ó¥B¤]¯à¥¿½T°õ¦æ¶×¤J¸ê®Æ,¦ý§¹¥þ¨SÅã¥Ü¥ô¦ó¸ê®Æ¶×¤J ¸ê®Æ·|ª½±µ¶i¤JµêªÅ¤§¤¤ ´Nºâdebug.print¥X¨Ó¤]¬O"ªÅ®ð" )
Sub Array_Arraylist2()
Dim ar(1)
Dim br(2, 2)
Set ar(0) = CreateObject("System.Collections.ArrayList")
ar(0).Add br
ar(0).Add ""
ar(0)(0)(0, 0) = 555
ar(0)(0)(0, 1) = 666
ar(0)(0)(0, 2) = 777
Debug.Print ar(0)(0)(0, 0)
Debug.Print ar(0)(0)(0, 1)
Debug.Print ar(0)(0)(0, 2)
End Sub
7.®i¥Ü¤@Ó vba°}¦C ¥] arraylist°}¦C ¨Ã½áȨúȪº¤èªk (¬°¤F³v¨B®i¥Ü ©Ò¥H¤£¥Î6ªº¤èªk)
Sub Array_Arraylist()
Dim ar(1)
Set ar(0) = CreateObject("System.Collections.ArrayList")
ar(0).Add ""
ar(0).Add ""
ar(0).Add Array(11, 12, 13, 14)
Set ar(0)(0) = CreateObject("System.Collections.ArrayList")
ar(0)(0).Add ""
ar(0)(0).Add ""
ar(0)(0).Add ""
ar(0)(0).Add ""
ar(0)(0)(0) = 331
ar(0)(0)(1) = 332
ar(0)(0)(2) = 333
ar(0)(0)(3) = 334
Debug.Print ar(0)(0)(0)
Debug.Print ar(0)(0)(1)
Debug.Print ar(0)(0)(2)
Debug.Print ar(0)(0)(3)
End Sub
¬ã¨s¨ì³Ì«á
Y¥u¥Îarraylist ´N¥i¥Hª½±µ¶×¤Jקï
¦ý¦pªG¥Îarraylist ¥]vba°}¦C
¥u¦³¨âÓ¤èªk¯à³B²z קï
º¥ýÁקK¥Îarraylist¥]vba°}¦Cªº§Î¦¡ ¦ývba°}¦C¥i¥H¥]arraylist
¦ý´N·Qª½±µarraylist¥]°}¦C«ç»ò¿ì ¥]¬A«á±¥Î .Add Array(1,2,3,4) ³oºØ1ºû°}¦C¤]ºâ
²Ä¤@ ¨Ï¥Îadd+removeat ©Îremoveªº¤è¦¡×§ï
²Ä¤G ¶×¤Jvba°}¦C®É ¸ê®Æ´Nn¥ý¿é¤J¦n¤F ¿é¤J¦n¤§«á´N¤£¯à¦A§ï |
|
|
|
|
|
|
- ©«¤l
- 354
- ¥DÃD
- 5
- ºëµØ
- 0
- ¿n¤À
- 387
- ÂI¦W
- 0
- §@·~¨t²Î
- windows7
- ³nÅ骩¥»
- vba,vb,excel2007
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2017-1-8
- ³Ì«áµn¿ý
- 2024-8-2
|
¥»©«³Ì«á¥Ñ singo1232001 ©ó 2022-2-12 03:23 ½s¿è
Sub Array_Arraylist3()
Dim ar(1)
Dim br(2, 2)
Set ar(0) = CreateObject("System.Collections.ArrayList")
ar(0).Add br
ar(0).Add ""
ar(0).Add Array(1, 2, 3, 4)
ar(0)(0)(0, 0) = 555
ar(0)(0)(0, 1) = 666
ar(0)(0)(0, 2) = 777
Debug.Print ar(0)(0)(0, 0) & "ªÅ¥Õ"
Debug.Print ar(0)(0)(0, 1) & "ªÅ¥Õ"
Debug.Print ar(0)(0)(0, 2) & "ªÅ¥Õ"
Debug.Print ar(0)(2)(0)
Debug.Print ar(0)(2)(1)
Debug.Print ar(0)(2)(2)
Debug.Print ar(0)(2)(3)
End Sub
¤Wz§Ú¨Ï¥Î¤F¨âºØ¤£¦Pªºarraylist¥]vba°}¦C¶×¤J¤è¦¡
¤@ºØ¬OªÅ¥Õvba°}¦Cbr(2,2)
¤@ºØ¬O쥻´N¦³¸ê®Æªºvba°}¦C array(1,2,3,4)
³Ì«á¦³¸ê®Æªº¬O²Ä¤GºØ
ÁöµM²Ä¤@ºØ¤]¯à°õ¦æ ¦ý¸ê®Æ¶i¤£¥h
ª`·N ¦¹®×¨Ò»P¤W¤@½g¦^´_ªº¤£¦P
¤W¤@½g¬O¨Ï¥Î¥¿³Wªºarraylist´O®M¤èªk
©Ò¥Har(0)(0)(0) = 331 ¦³¶×¤J¦¨¥\
¦Ó¥»½gªº
ar(0)(0)(0, 0) = 555 ¶×¤J¥¢±Ñ
½Ð°ª¤â¸Ô¸Ñ¤@¤U ·PÁ ¬ÛÃö¸ê®Æ¹ê¦b§ä¤£¤Ó¨ì |
|
|
|
|
|
|
- ©«¤l
- 354
- ¥DÃD
- 5
- ºëµØ
- 0
- ¿n¤À
- 387
- ÂI¦W
- 0
- §@·~¨t²Î
- windows7
- ³nÅ骩¥»
- vba,vb,excel2007
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2017-1-8
- ³Ì«áµn¿ý
- 2024-8-2
|
¦^´_ 6# singo1232001
¬Ý³oÓ·|§ó¥[ª½Æ[
Sub Array_Arraylist4()
Dim ar(0): Dim br(2): Dim cr(2)
cr(0) = "97": cr(1) = "98": cr(2) = "99":
Set ar(0) = CreateObject("System.Collections.ArrayList")
ar(0).Add br
ar(0).Add Array(1, 2, 3)
ar(0).Add cr
ar(0)(0)(0) = 555
ar(0)(0)(1) = 666
ar(0)(0)(2) = 777
Debug.Print ar(0)(0)(0) & " brªÅ¥Õ"
Debug.Print ar(0)(0)(1) & " brªÅ¥Õ"
Debug.Print ar(0)(0)(2) & " brªÅ¥Õ"
Debug.Print ar(0)(1)(0) & " Array(1, 2, 3, 4)¦³ªF¦è"
Debug.Print ar(0)(1)(1) & " Array(1, 2, 3, 4)¦³ªF¦è"
Debug.Print ar(0)(1)(2) & " Array(1, 2, 3, 4)¦³ªF¦è"
Debug.Print ar(0)(2)(0) & " cr¦³ªF¦è"
Debug.Print ar(0)(2)(1) & " cr¦³ªF¦è"
Debug.Print ar(0)(2)(2) & " cr¦³ªF¦è"
'----¥H¤U¬O¦barraylist«á ·s¼W¤@Ó¥¿±`ªºarraylist ¨Ã¥B¥i¥H½áȨúÈ
ar(0).Add ""
Set ar(0)(3) = CreateObject("System.Collections.ArrayList")
ar(0)(3).Add ""
Set ar(0)(3)(0) = CreateObject("System.Collections.ArrayList")
ar(0)(3)(0).Add "¥¿±`ªºarraylist·s¼W"
Debug.Print ar(0)(3)(0)(0)
ar(0)(3)(0)(0) = "¥¿±`ªºarraylistקï«á"
Debug.Print ar(0)(3)(0)(0)
End Sub
³o´N¬Oarraylist ³oÓ§|«ÜÁV¿|ªºì¦]
¦ý¦b¬Y¨Ç¸ê®Æ¶q«Ü¤j¤Sn°Ï¤Àªº±¡ªp¤U ¤S¤£±o¤£¥Î¥L |
|
|
|
|
|
|