📜  vba 集合键列表 - VBA 代码示例

📅  最后修改于: 2022-03-11 14:51:54.882000             🧑  作者: Mango

代码示例1
' Use a Dictionary instead of a Collection
Dim dict As Dictionary
Set dict = New Dictionary

dict.Add "key1", "value1"
dict.Add "key2", "value2"

Dim key As Variant
For Each key In dict.Keys
    Debug.Print "Key: " & key, "Value: " & dict.Item(key)
Next