analyzing data with VBA
sorry - don't have 7 days. And I can't give you the spreadsheet for business
security.
I didn't pay for the code - borrowed it from a finance spreadsheet.
The original sheet the data is pulling from will be overwritten up to
several times each day. So I have a button that clears the all last copied
data and then the code seeks each line for the corresponding header date and
pulls the attribute counts.
The original spreadsheet looks like this:
ID#|Date |D1|D2|D3|D4|P1|P2|P3|P4|A1|A2|A3|A4
001|021009| 1| 0| 0| 0| 0| 0|1| 1| 0| 1| 3| 2
011|020909| 0| 0| 0| 0| 1| 0|0| 0| 3| 2| 0| 2
800|020909| 0| 0| 0| 0| 0| 0|0| 0| 0| 2| 1| 0
001|020809| 0| 0| 1| 0| 0| 0|0| 0| 1| 2| 0| 3
076|020909| 1| 0| 0| 0| 0| 0|0| 0| 2| 2| 2| 1
800|020909| 1| 0| 0| 0| 0| 0|0| 0| 3| 3| 1| 0
034|021709| 1| 0| 0| 0| 0| 0|0| 0| 2| 2| 1| 3
I want to return the count of each attribute for each date where there is a
"1" in column "D1" and put it in a worksheet labeled "D1" - and repeat that
for each department & each project.
So on sheet D1 I should see that on 2/9, A1 had a 2 & 3, A2 had a 2 & 3, A3
had a 1 & 2, A4 had a 1; on 2/10, A2 had a 1, A3 had a 3 & A4 had a 2; on
2/17 A1 had a 2, A2 had a 2, A3 had a 1 and A4 had a 3
I shouldn't have even posted the code. I should've just posted this.
|