I know in Python you can assign a value to an array index that doesn't exist yet. That's what I want to mimic in VBA if possible.
For example, I have a list of accounts and items they map to:
40100 => 1
42000 => 2
43000 => 8
44456 => 27
What i want is an array that I can get values from like this: arr(40100) = 1, arr(43000) = 8.
In my current workaround, I have to dimension the array to be lbound() = 40100 and ubound() = 44456 and only (4) items have values. That works, but it seems like a waste of memory and is more difficult to scroll through in the locals window.
For reference, in Python currently, the code is:
str1 = str(acct[0][0:5])
account_map[str1] = acct_holder[:]
For example, I have a list of accounts and items they map to:
40100 => 1
42000 => 2
43000 => 8
44456 => 27
What i want is an array that I can get values from like this: arr(40100) = 1, arr(43000) = 8.
In my current workaround, I have to dimension the array to be lbound() = 40100 and ubound() = 44456 and only (4) items have values. That works, but it seems like a waste of memory and is more difficult to scroll through in the locals window.
For reference, in Python currently, the code is:
str1 = str(acct[0][0:5])
account_map[str1] = acct_holder[:]