第26å Excel VBAã§ããã·ã¥ã使ã
CreateObject("Scripting.Dictionary")
ã§ããã·ã¥ãåå¾ã§ããã代å
¥æã«ã¯Setãå¿
è¦ã
Setãå¿
è¦ãªå ´é¢ã¯ãªãã¸ã§ã¯ãåã®ä»£å
¥ã®ããã ã
Rubyã®ããã«å
¨é¨ãªãã¸ã§ã¯ãã«ãã¨ãã¦ã»ããããããã§ããªããããªã®ã§ã
è¦ããã»ããæ©ããã§ããã
Setãå¿
è¦ãªãã®ã¯ã¯ã¼ã¯ã·ã¼ããRangeã®ããã§ããã
Rangeã®Valueãªã©ã¯ãé
åãè¿ã£ã¦ããã®ã§ãã®å ´åã¯ãSetã¯ä»ããªã模æ§ã
ããã·ã¥ã®ä½¿ç¨ä¾ï¼
Sub ããã·ã¥ã®ä¾() Dim hash Set hash = CreateObject("Scripting.Dictionary") hash.Add "AA", 50 hash.Add "BB", 60 Debug.Print Join(Array(hash("AA"), hash("BB")), ",") Debug.Print Join(hash.Keys, ",") Debug.Print Join(hash.items, ",") End Sub
åèï¼
No.17 VBAで連想配列 〜 Scripting.Dictionary