I want to load dictionary table of following structure to an array (dictionary? UDT class?), say "dictCompany", CompanyName is unique key.
CompanyName | PersonName | PersonPhone
ABC Ltd | Nick | +12345
XYZ Co | Alice | +78901
And then I need to find entries by CompanyName and refer to other columns like dictCompany.PersonName or dictCompany.PersonPhone, something like this pseudo-code:
Dim i as Long
Dim dictIndex as Long
For i = 0 To UBound(dictCompany)
If dictCompany(i).CompanyName = "ABC Ltd" Then
dictIndex = i
End If
Next i
debug.print dictCompany(dictIndex).PersonName 'should get "Nick"
debug.print dictCompany(dictIndex).PersonPhone 'should get "+12345"
I don't know what technology to use - array, dictionary, UDT class or whatever VBA has, so I would appreciate even directional answers with keywords for furhter search.