Noob question. I realize this has probably been asked before, but I still need some help as I have never worked with dictionaries in VBA.
I found a nice piece of code which turns columns into a dictionary which is exactly what i need (see below) but once it converts a range into a Dictionary, I can not figure out how to do anything with it. even simple Debug.Print or loop through the keys values. I went through countless articles and youtube videos (explaining dictionaries, but nothing "this advanced"), I'm missing something.
Sub Test()
RangeToDict2 Range("H2:I36")
Debug.Print RangeToDict2.Item("a") 'FAILS HERE
End Sub
Function RangeToDict2(ByVal R As Range) As Dictionary
Set RangeToDict2 = New Dictionary
i = 1
Do Until i >= (R.Rows.Count * R.Columns.Count)
RangeToDict2.Add R(i), R(i + 1)
Debug.Print R(i) & ", " & R(i + 1)
i = i + 2
Loop
End Function