Adds a key and item pair to a Dictionary object.
An error occurs if the key already exists.
The following example illustrates the use of the Add method.
Dim d ' Create a variable.
Set d = CreateObject("Scripting.Dictionary")
d.Add "a", "Athens" ' Add some keys and items.
d.Add "b", "Belgrade"
d.Add "c", "Cairo"
本文介绍如何利用VBA中的Dictionary对象添加键值对,并通过示例代码演示了当键已存在时会触发错误的情况。
6万+

被折叠的 条评论
为什么被折叠?



