VBA – Put a Collection inside a Scripting Dicitonary OR Make an Updateable ComboBox

The idea of the article is to make an updateable combobox, which takes all the keys of column A and writes them to the ComboBox. Then, upon selection of the corresponding values in the combobox, it provides the corresponding values in column “G”:

How does it work?

In Worksheet tblMain we set the following events:

The idea of the events is to generate 2 things only:

    • The Worksheet_Change event updates the values of the Combo Control;
    • The cmbTeams_Click event updates the values in column G;

The  modMain has the following code:

Thus, in the fillTeamDictionary there is a way to put a collection to the Dictionary with the following code:

That’s all folks!

About

A VBA Developer.

Tagged with: , , , , ,