I am trying to use a dictionary of dictionaries in Excel VBA. I am trying to find out if there is already a key in the enclosed dictionary, and if not, add it.
My data is as follows:
Country, Customer, Purchased US, Alan, Lawnmower US, Alan, Hammer US, Karen, Donkey US, Simon, Mustang MX, Carl, Lawnmower MX, Alan, Donkey ...
The data structure that I mean looks like dictionary --> dictionary --> array - i.e. country --> customer --> purchased .
The code I use to find out if a country exists in the country dictionary:
If Not dataset.Exists(country) Then ...
However, code that looks like this does not work:
If Not dataset.Exists(country)(customer) Then ....
How do you check the next level of entries in a dictionary? Is this a case of storing the contents of a country dictionary in an array, and then checking for (what seems like a mess)?
source share