title: Can I loop through key/value pairs in a VBA collection?
body: <p>In VB.NET, I can iterate through a dictionary's key/value pairs:</p>
  
  <pre><code>Dictionary&lt;string, string&gt; collection = new Dictionary&lt;string, string&gt;();
  collection.Add("key1", "value1");
  collection.Add("key2", "value2");
  
  foreach (string key in collection.Keys)
  {
      MessageBox.Show("Key: " + key + ".  Value: " + collection[key]);
  }
  </code></pre>
  
  <p>I know in VBA I can iterate through the <em>values</em> of a Collection object:</p>
  
  <pre><code>Dim Col As Collection
  Set Col = New Collection
  Dim i As Integer
  Col.Add "value1", "key1"
  Col.Add "value2", "key2"
  
  For i = 1 To Col.Count
      MsgBox (Col.Item(i))
  Next I
  </code></pre>
  
  <p>I also know that I do this with a Scripting.Dictionary VBA object, but I was wondering if this is possible with collections.</p>
  
  <p>Can I iterate through key/value pairs in a VBA collection?</p>