I am struggling to make my Dictionary object work to return economic details of selected Reference number.
e.g. I have below reference nos and corresponding values, however, not sure if I can achieve this using Dictionary object , and alternative, suggestion would be highly appreciated.
Ref No Amount Price Year
IB1232 1000 1.23 2011
IB1231 1000 3.23 2011
IB1233 1000 3.43 2011
IB1234 1000 3.43 2011
I thought would be able to achieve by forming Key and Value for reference and their corresponding details, but not been able to achieve ..
I don’t know what you’re referring to as Dictionary in VBA, as the data structure with the said functionality is called
Collectionin VBA (but maybe you coded your own Ditionary, in that case we need the code in order to be able to help you).If I get your example right, you want to access e.g {1000,1.23,2011} via the key “IB1232”. You can do this easily by creating a Collection of Collections like this:
To access your data just get the desired record (Collection) via the key
You can also use an array of Variants for the data