vba collection key list

The solution for “vba collection key list” can be found here. The following code will assist you in solving the problem.

‘ 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)

Thank you for using DeclareCode; We hope you were able to resolve the issue.

More questions on [categories-list]

Similar Posts