Answers for "vba collection how to view the key"

VBA
0

vba collection key list

' 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
Posted by: Guest on January-31-2021

Code answers related to "vba collection how to view the key"

Code answers related to "VBA"

Browse Popular Code Answers by Language