Answers for "VBA Dictionary Data Type"

VBA
0

VBA Dictionary Data Type

Sub DictionaryBasicSetup()
    ' (1) set up the VBA dictionary object (Tools > References > Microsoft Scripting Runtime)
    ' (2) insert two random values in the dictionary
    ' (3) print the values to the immediate window be referencing the keys
    Dim dict As Scripting.Dictionary

    Set dict = New Scripting.Dictionary
    
    ' insert some random items
    dict("Alice") = "555-778-0131" 
    dict("Bob") = "555-202-0114"
    
    ' print items to the immediate window
    Debug.Print dict("Alice")
    Debug.Print dict("Bob")

End Sub
Posted by: Guest on April-19-2022

Code answers related to "VBA"

Browse Popular Code Answers by Language