I don't understand some parts in the following code:
For i = 2 To UBound(a, 1)
txt = Join$(Array(a(i, 3), a(i, 4)), Chr(2))
If Not dic.exists(txt) Then
Set dic(txt) = CreateObject("Scripting.Dictionary")
End If
dic(txt)(a(i, 1)) = VBA.Array(a(i, 5), a(i, 6), a(i, 2))
Next
- Q1: Why set dic(txt) in the loop code
- Q2: dic(txt)(a(i,1)) => Why they use (a(i,1))
Thanks alot
awith a counter ofi, it is joininga(i,3)anda(i,4)and if the result of this jointxtdoes notexistin thedictionarydicit creates an entry fortxtas the key in thedicthen it sets this new or existing entrytxtbydic(txt)with the item ofa(i,1)to be the array created usingvba.arrayI think (it's friday afternoon) need a beer :-) I think it's getting the last value ofa(i, 5), a(i, 6), a(i, 2)and making it accessible in a dictionary via the keya(i, 3), a(i, 4))