I have the following data: ID | Company | RDate
I want to create a dictionary or collection with the ID as key and (Company, RDate) as the value.
The error I am receiving is that I have a type-mismatch on the line where I try to add the key and tuple to the collection.
Ideal structure: ID, (Company, RDate)
Key, (Value A, Value B)
Below is my attempt:
Demo code
Dim ID As String
Dim Company As String
Dim RDate As Date
Dim myCol As Collection
Set myCol = New Collection
myCol.Add Array(Company, RDate), ID
Dim myVar As Variant
For Each myVar In myCol.Keys 'this is just code to test that I successfully added the data to the collection
Debug.Print myCol(myVar)(LBound(myCol(myVar)))
Next myVar