Created
August 16, 2018 13:08
-
-
Save rikukissa/dc9b0b598cec5132010b7dad6828bdcd to your computer and use it in GitHub Desktop.
Dictionary printer for Visual Basic
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function PrintDict(Dict as Dictionary, Optional ByVal Stack as String = "") | |
For Each Key In Dict.Keys() | |
If TypeOf Dict(Key) Is Dictionary Then | |
Debug.Print Stack & Key & ":" | |
PrintDict Dict(Key), Stack & " " | |
Else | |
Debug.Print Stack & Key & ": " & Dict(Key) | |
End If | |
Next | |
End Function |
I think it is for the standard one yes 🤔
https://excelmacromastery.com/vba-dictionary/#A_Quick_Guide_to_the_VBA_Dictionary
Have you done the first item from this list?
“Microsoft Scripting Runtime”(Add using Tools->References from the VB menu)"
I haven't yet as I want this app to function on a Mac also, so don't want to rely on the built in Scripting Dictionary....
There is another version that I may go back to....
Sure 👍 you can achieve the same with any Dict type just by modifying the code a bit. The basic idea of how the inputted Dict is looped through should be the same
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, is this for the standard Scripting Dictionary in Windows?
I'm using a VBA one for excel from git hub...
It's not playing nice with a for each loop
Would this function do the trick?