Manuel Cavero
New Member
- Joined
- Feb 17, 2018
- Messages
- 26
Hello everyone:
I have some dictionaries with values, and I need to calculate the correlation between the values of dictionaries. Let's see the code:
Here the problem is how to loop through the colecction of Dictionaries (Dictionary.items)?
I have some dictionaries with values, and I need to calculate the correlation between the values of dictionaries. Let's see the code:
Code:
Sub Test()
Dim Dic1 as New Scripting.Dictionary
Dim Dic2 as New Scripting.Dictionary
Dim Dic3 as New Scripting.Dictionary
Dim Dictionaries as New Collection
Dim Correlation as double
Dim Dictionary as New Scripting.Dictionary
........
With Dic1[INDENT].add 1,2
.add 1,3
.add 1,4[/INDENT]
End With
With Dic2[INDENT].add 1,12
.add 1,13
.add 1,14[/INDENT]
End With
With Dic3[INDENT].add 1,22
.add 1,23
.add 1,24[/INDENT]
End With
'And here I'd need to loop through the dictionaries to determinate the correlation ?????
For each Dictionary in Dictionaries[INDENT]Application.WorksheetFunction.Correl(Dic1.items, Dic2.items)[/INDENT]
Next Dictionary
end Sub
Here the problem is how to loop through the colecction of Dictionaries (Dictionary.items)?