The purpose of this code is to be able to track multiple properties of undefined "IDs," like name, total time, and occurrences while going through ton of data. As of right now I am using a jagged array to achieve this.
idArray = array of all gathered ID's in data
idProp = array of properties of each ID
I had everything working perfectly till I added the nested array.
I need to be able to check while going through the data if the ID is a new or not. with the name of each ID being held in the nested array i can't seem to be able to do this. Here is what i have so far:
For Each ID In idArray()(1) '<-- does not target nested array correctly
If ID = wbData.Sheets(1).Range("C" & Count) Then
idPrs = True
End If
Next ID
'adding ID if not present
If idPrs = False Then
idCount = idCount + 1
MsgBox "new ID: " & wbData.Sheets(1).Range("C" & Count) & " on row " & Count
ReDim Preserve idArray(0 To idCount)
ReDim idProp(0 To 2)
'adding starting values
idProp(0) = wbData.Sheets(1).Range("C" & Count)
idProp(1) = wbData.Sheets(1).Range("h" & Count)
idProp(2) = 1
idList(gidCount) = idProp
'double array second "()" referrs to second array
'MsgBox idArray(1)(0)
End If
any ideas are welcome, even if they are done a completely different way.
It's not entirely clear how you are declaring or popuplating your
idArray
.This small demo of jagged arrays might give you some hints:
Dictionaries could better tend to your problem. Here is a solution with a dictionary of dictionaries: