Tricky Macro Coding Question
I have a macro that churns down through a column of dates ("For Each cel in
Selection...") and accumulates (count and sum) certain information from that
row. When the macro reaches the end of a month, I need it to transfer the
accumulated values to another area of the spreadsheet, then zero out the
"accumulator" cells and start over again for the new month.
My problem is that the area the accumulated values are moved to is itself a
range corresponding to months; if the accumulated values are for January I
need to put them under January, if they're for April they go under April, and
so on. I can do that with another "For Each cel" selection routine, but that
breaks the connection to the ORIGINAL selection, causing me to in effect
"lose my place" in that column of dates.
Can anybody suggest how to move the accumulated values to the correct
position in my months range while remembering where I was in the dates range
and resuming the process from that point?
|