Hi, I have been battling to understand why an array is not being updated where the array is in place of a key/value pair.
I have the following in VBA:
And in my Immediate Window I get the following:
Before: 64
After: 64
However, my expectation is that I would get:
Before: 64
After: 190.5
I have the following in VBA:
VBA Code:
Dim testDict As Object
Dim testKey As String
Dim arr(1) As Double
Set testDict = CreateObject("Scripting.Dictionary")
testKey = "TestKey"
arr(0) = 64
arr(1) = 0
testDict.Add testKey, arr
Debug.Print "Before: "; testDict(testKey)(0)
testDict(testKey)(0) = testDict(testKey)(0) + 126.5
Debug.Print "After: "; testDict(testKey)(0)
And in my Immediate Window I get the following:
Before: 64
After: 64
However, my expectation is that I would get:
Before: 64
After: 190.5