Hello Chandoo. It's been a while.
I have a dynamic range of data
where LastDate and LastCol are functioning variables that help define the size of the range, as it will change over time. It's usually about 700 rows long and 60 columns wide.
I am attempting to create a dictionary in which each individual key is comprised of all the data in separate columns within DataRange. These keys will be outputted as an array later.
So for instance, key 1 would be all the data in the following range:
My question is, how can I get Excel to store an entire column from this range as a key within a dictionary and then move onto the next column? If it were a single column of values where each cell were to be an individual key I'd do this:
I just can't seem to get the syntax in such a way that Excel will store a group of cells from an entire column as a key.
I have a dynamic range of data
Code:
DataRange = Range(Cells(11, 4), Cells(LastDate, LastCol))
I am attempting to create a dictionary in which each individual key is comprised of all the data in separate columns within DataRange. These keys will be outputted as an array later.
So for instance, key 1 would be all the data in the following range:
Code:
Range(Cells(11,4), Cells(LastDate,4))
Code:
For i = 1 To DataRange.Rows.Count
DataDict.Add DataRange(i, 1).Value, 1 'the '1' is arbitrary as a dictionary item can't be left blank
Next i