VBA 連想配列

■コード

Sub test()

Set dictionary = CreateObject("Scripting.Dictionary")

dictionary.Add "abc", "yyy"

dictionary.Add "def", "zzz"

Debug.Print dictionary.exists("abc")

Debug.Print dictionary.exists("xyz")

Debug.Print dictionary.Item("abc")

Debug.Print dictionary.Item("xyz")

End Sub

■結果

True

False

yyy