3

I had to cobble together some code in Excel/VBA and vaguely remember we used to add a reference to Microsoft Scripting Runtime to use Dictionary. Now in the days of Office 2010, is that still the preferred way of getting access to a Dictionary like structure or have things moved on?

Community
  • 1
  • 1
Ian
  • 4,885
  • 4
  • 43
  • 65

2 Answers2

4

Dictionaries are still used the same old way in Excel VBA -- Read more here Does VBA have Dictionary Structure?

But there is an alternative to dictionary objects, using Collections More about that here: Using Dictionary Object in Excel VBA

Community
  • 1
  • 1
Ahmad
  • 12,336
  • 6
  • 48
  • 88
1

Be aware! Microsoft Scripting Runtime does not work on Mac. There is a workaround though. Get this https://github.com/VBA-tools/VBA-Dictionary and import Dictionary.cls into your VBA project. This will create a Dictionary class that will be used instead of the one in Microsoft Scripting Runtime

Tomas Hesse
  • 385
  • 3
  • 10