Sort keys in dictionary
<p>I have a set of numeric keys I want sorted from smallest to largest.  </p>

<pre><code>Dim result
Set result = CreateObject("Scripting.Dictionary")

For i = 1 To N
    weeksThisIteration = 0

    Do While conditiaonTrue
        //...
        weeksThisIteration = weeksThisIteration + 1
    Loop

    'If Not result.Item(weeksThisIteration) Then
    '    result.Add weeksThisIteration, 0//apparently I don't have to initiailize
    'End If

    result.Item(weeksThisIteration) = result.Item(weeksThisIteration) + 1
</code></pre>

<p>I want to sort <code>result</code>, preferably within a sub/function.  I tried:</p>

<ul>
<li>Creating a sub <code>MySort(list As Scripting.Dictionary)</code></li>
</ul>

<p>I had problems passing the value.  I added a reference to "Microsoft Scripting Runtime".  I still got an error about passing ByRef when I called the method, plus I'm unsure of the implementation.</p>

<ul>
<li>Calling a native function <code>SortDictionary</code>.  VBA said the func doesn't exist.  </li>
</ul>

<p>How can I implement a numeric KEY sort in a method and call it with this data type?</p>