What is the best VBA data type`key`=>`value` to save data same as PHP array

Viewed 39838

I'm working with VBA and need to save data in type key=>value to getting fastest; This data type help me cache responese text from http request, increase query speed. But I don't know what is the best way to do it? I need a data type same as php array with key=>value! Thank for help!

2 Answers

Above answer will not work because of wrong syntax you need to add Scripting Keword before also enable Microsoft Sripting Run Time I tried it with and Without Sripting. before Dictionary in MS word(2016) and without dosen't work even if you have enabled Microsoft Scripting runtime

 Dim dict As Scripting.Dictionary
 Set dict = New Scripting.Dictionary
 dict.Add "John", 34
 dict.Add "Jane", 42
 dict.Add "Ted", 402

 Debug.Print "Number of items stored: " & dict.Count
 Debug.Print "Ted is " & dict.Item("Ted") & " years old"
Related