- ©«¤l
- 1447
- ¥DÃD
- 40
- ºëµØ
- 0
- ¿n¤À
- 1471
- ÂI¦W
- 0
- §@·~¨t²Î
- Windows 7
- ³nÅ骩¥»
- Excel 2010 & 2016
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW
- µù¥U®É¶¡
- 2020-7-15
- ³Ì«áµn¿ý
- 2024-12-5
|
¥»©«³Ì«á¥Ñ Andy2483 ©ó 2023-4-13 09:58 ½s¿è
'·í«á¤èªºµ{§Ç¤£»Ýn¥Î¨ìitemÈ®É,´NÀH·Nµ¹Ó¦r¤¸(""ªÅ¦r¤¸¬O³Ì±`¥Îªº)
'´N¹³§Q¥Î¦r¨åªºkey¨ÓÂo±¼«½ÆªºÈ³Ì±`¥Î¨Ó¨ú¥N²©öªº ¶i¶¥¿z¿ï
Option Explicit
Sub °ê»y¦r¨å_ªÅ¦r¤¸ªºitem()
Dim xD, Arr, Brr
Set xD = CreateObject("Scripting.Dictionary")
xD("¦Y") = ""
'¡ô¦r¦ê"¦Y"¬Okey ,¦r¦ê""¬OItem
xD("³Ü") = ""
'¡ô¦r¦ê"³Ü"¬Okey ,¦r¦ê""¬OItem
xD("ª±") = ""
'¡ô¦r¦ê"ª±"¬Okey ,¦r¦ê""¬OItem
xD("¼Ö") = ""
'¡ô¦r¦ê"¼Ö"¬Okey ,¦r¦ê""¬OItem
Arr = xD.keys
'¡ô(¦r¨åKeys¥»¨´N¬O°}¦C) ,¦P¸q Arr = Array("¦Y", "³Ü", "ª±", "¼Ö")
Brr = xD.Items
'¡ô(¦r¨åItems¥»¨¤]¬O°}¦C),
'¦P¸q Brr = Array("", "", "", "")
'³o¦r¨å¸Ì¦³4Ó°ê¦r(keys) ¤Î³o4Ó°ê¦rªº¸ÑÄÀ(items(ªÅ¦r¤¸))
MsgBox xD("¦Y")
MsgBox xD("³Ü")
MsgBox xD("ª±")
MsgBox xD("¼Ö")
MsgBox Arr(0)
MsgBox Arr(1)
MsgBox Arr(2)
MsgBox Arr(3)
MsgBox Brr(0)
MsgBox Brr(1)
MsgBox Brr(2)
MsgBox Brr(3)
xD("¦Y") = "©CÄZ¹ª««á§]¤U"
'³o®É¦r¨å¸Ì¤@¼Ë¦³4Ó°ê¦r(keys) ¤Î³o4Ó°ê¦rªº¸ÑÄÀ(items)
'¤£¤@¼Ëªº¬O keys¸Ìªº"¦Y"¹ïÀ³ªºitem¥Ñ("")Åܦ¨¤F "©CÄZ¹ª««á§]¤U"
MsgBox xD("¦Y")
Arr = xD.keys
'keys¸Ìªº"¦Y"¤@¼Ë±Æ¦bº¦ì
Brr = xD.Items
MsgBox Arr(0)
MsgBox Brr(0)
'³oµ{§Ç¸Ì¯Ç¤J¹L5¦¸¦r¤¸¨ìxD¦r¨åªºkeys¸Ì,¦ý¬Okey¤£·|«½Æ
'¯Ç¤J¹L5¦¸¦r¤¸ : "¦Y", "³Ü", "ª±", "¼Ö", "¦Y"
'³Ì²×¥u¦³³o4Ó "¦Y", "³Ü", "ª±", "¼Ö"
'¬JµM«á¤èªºµ{§Ç¤£»Ýn¥Î¨ìitem,´NÀH·Nµ¹Ó""(ªÅ¦r¤¸)§a!
End Sub |
|