I'm not too good with arrays (yet), but am beginning to suspect that they are intended to be sources of data and not destinations. I have a column of data that is based on sequential dates that I need to put into a calendar-style orientation, i.e., 7 days across, then on to the next week. My code currently looks like this:
data_range is the cell range where I want the numbers to go. The existing column of data is not referenced in this bit of code, but it is the ActiveCell.Value.
So what am I doing wrong here?
Code:
Const maxr = 52, maxc = 7
Dim data_range(1 To maxr, 1 To maxc) As Variant
data_range = Range("D3:K54")
For r = 1 To maxr
For c = 1 To maxc
data_range(r, c) = ActiveCell.Value
ActiveCell.Offset(1, 0).Activate
Next c
Next r
data_range is the cell range where I want the numbers to go. The existing column of data is not referenced in this bit of code, but it is the ActiveCell.Value.
So what am I doing wrong here?