QuestionBaker
Board Regular
- Joined
- Apr 12, 2019
- Messages
- 106
- Office Version
- 365
- Platform
- Windows
I have a data similar to the following
I want sum of Data1, Data2, Data3 for Tag 1, Tag2 and so on
I am using a dictionary with Tags as keys and 3 len array as value whose each element is initialized to 0
I am unable to update values in the array
My code looks something like this (not the actual code)
But the reassignment does not work
If I check the immediate window, it outputs False
I want sum of Data1, Data2, Data3 for Tag 1, Tag2 and so on
I am using a dictionary with Tags as keys and 3 len array as value whose each element is initialized to 0
I am unable to update values in the array
My code looks something like this (not the actual code)
VBA Code:
dim dict as new dictonary
dim arr(1 to 3) as double
arr(1) = 0
arr(2) = 0
arr(3) = 0
for each non empty cell in column A from A2
if not dict.exist(cell.value) then
dict(cell.value) = arr
end if
dict(cell.value)(1) = dict(cell.value)(1) + corresponding cell in B Col
dict(cell.value)(2) = dict(cell.value)(2) + corresponding cell in C Col
dict(cell.value)(3) = dict(cell.value)(3) + corresponding cell in D Col
next cell
If I check the immediate window, it outputs False