Hello,
I am looking for some assistance in writing a macro to transpose timespread data that is coming out of a program that I use. I need to be able to make a calculation on the data, then put it back into a pivot table to spread it again by period. I only need help getting the data from timespread to data table. See example below. The columns 1 and 2 need to be repeated for every period. The periods, will be changing every time i run the report.
Thank you for your help.
[TABLE="class: grid, width: 691"]
<colgroup><col><col><col><col><col><col span="4"><col></colgroup><tbody>[TR]
[TD]From this[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Project[/TD]
[TD]Resource[/TD]
[TD]Field[/TD]
[TD="align: right"]01-Dec[/TD]
[TD="align: right"]01-Jan[/TD]
[TD="align: right"]01-Feb[/TD]
[TD="align: right"]01-Mar[/TD]
[TD="align: right"]01-Apr[/TD]
[TD="align: right"]01-May[/TD]
[TD="align: right"]01-Jun[/TD]
[/TR]
[TR]
[TD]Job A[/TD]
[TD]Resource 1[/TD]
[TD]Hours[/TD]
[TD="align: right"]20[/TD]
[TD="align: right"]20[/TD]
[TD="align: right"]20[/TD]
[TD="align: right"]20[/TD]
[TD="align: right"]20[/TD]
[TD="align: right"]20[/TD]
[TD="align: right"]20[/TD]
[/TR]
[TR]
[TD]Job A[/TD]
[TD]Resource 2[/TD]
[TD]Hours[/TD]
[TD] [/TD]
[TD="align: right"]30[/TD]
[TD="align: right"]30[/TD]
[TD="align: right"]30[/TD]
[TD="align: right"]30[/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]Job B[/TD]
[TD]Resource 3[/TD]
[TD]Hours[/TD]
[TD] [/TD]
[TD] [/TD]
[TD="align: right"]20[/TD]
[TD="align: right"]20[/TD]
[TD="align: right"]20[/TD]
[TD="align: right"]20[/TD]
[TD="align: right"]20[/TD]
[/TR]
[TR]
[TD]Job C[/TD]
[TD]Resource 4[/TD]
[TD]Hours[/TD]
[TD] [/TD]
[TD="align: right"]50[/TD]
[TD="align: right"]50[/TD]
[TD="align: right"]50[/TD]
[TD="align: right"]50[/TD]
[TD="align: right"]50[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]Job C[/TD]
[TD]Resource 5[/TD]
[TD]Hours[/TD]
[TD="align: right"]10[/TD]
[TD="align: right"]10[/TD]
[TD="align: right"]10[/TD]
[TD="align: right"]10[/TD]
[TD="align: right"]10[/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]Job B[/TD]
[TD]Resource 6[/TD]
[TD]Hours[/TD]
[TD] [/TD]
[TD="align: right"]30[/TD]
[TD="align: right"]30[/TD]
[TD="align: right"]30[/TD]
[TD="align: right"]30[/TD]
[TD="align: right"]30[/TD]
[TD="align: right"]30[/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="class: grid, width: 289"]
<colgroup><col><col><col><col></colgroup><tbody>[TR]
[TD]Into this[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Project[/TD]
[TD]Resource[/TD]
[TD]Period[/TD]
[TD]Hours[/TD]
[/TR]
[TR]
[TD]Job A[/TD]
[TD]Resource 1[/TD]
[TD="align: right"]01-Dec[/TD]
[TD="align: right"]20[/TD]
[/TR]
[TR]
[TD]Job A[/TD]
[TD]Resource 1[/TD]
[TD="align: right"]01-Jan[/TD]
[TD="align: right"]20[/TD]
[/TR]
[TR]
[TD]Job A[/TD]
[TD]Resource 1[/TD]
[TD="align: right"]01-Feb[/TD]
[TD="align: right"]20[/TD]
[/TR]
[TR]
[TD]Job A[/TD]
[TD]Resource 1[/TD]
[TD="align: right"]01-Mar[/TD]
[TD="align: right"]20[/TD]
[/TR]
[TR]
[TD]Job A[/TD]
[TD]Resource 1[/TD]
[TD="align: right"]01-Apr[/TD]
[TD="align: right"]20[/TD]
[/TR]
[TR]
[TD]Job A[/TD]
[TD]Resource 1[/TD]
[TD="align: right"]01-May[/TD]
[TD="align: right"]20[/TD]
[/TR]
[TR]
[TD]Job A[/TD]
[TD]Resource 1[/TD]
[TD="align: right"]01-Jun[/TD]
[TD="align: right"]20[/TD]
[/TR]
[TR]
[TD]Job A[/TD]
[TD]Resource 2[/TD]
[TD="align: right"]01-Dec[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]Job A[/TD]
[TD]Resource 2[/TD]
[TD="align: right"]01-Jan[/TD]
[TD="align: right"]30[/TD]
[/TR]
[TR]
[TD]Job A[/TD]
[TD]Resource 2[/TD]
[TD="align: right"]01-Feb[/TD]
[TD="align: right"]30[/TD]
[/TR]
[TR]
[TD]Job A[/TD]
[TD]Resource 2[/TD]
[TD="align: right"]01-Mar[/TD]
[TD="align: right"]30[/TD]
[/TR]
[TR]
[TD]Job A[/TD]
[TD]Resource 2[/TD]
[TD="align: right"]01-Apr[/TD]
[TD="align: right"]30[/TD]
[/TR]
[TR]
[TD]Job A[/TD]
[TD]Resource 2[/TD]
[TD="align: right"]01-May[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]Job A[/TD]
[TD]Resource 2[/TD]
[TD="align: right"]01-Jun[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]Job B[/TD]
[TD]Resource 3[/TD]
[TD="align: right"]01-Dec[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]Job B[/TD]
[TD]Resource 3[/TD]
[TD="align: right"]01-Jan[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]Job B[/TD]
[TD]Resource 3[/TD]
[TD="align: right"]01-Feb[/TD]
[TD="align: right"]20[/TD]
[/TR]
[TR]
[TD]Job B[/TD]
[TD]Resource 3[/TD]
[TD="align: right"]01-Mar[/TD]
[TD="align: right"]20[/TD]
[/TR]
[TR]
[TD]Job B[/TD]
[TD]Resource 3[/TD]
[TD="align: right"]01-Apr[/TD]
[TD="align: right"]20[/TD]
[/TR]
[TR]
[TD]Job B[/TD]
[TD]Resource 3[/TD]
[TD="align: right"]01-May[/TD]
[TD="align: right"]20[/TD]
[/TR]
[TR]
[TD]Job B[/TD]
[TD]Resource 3[/TD]
[TD="align: right"]01-Jun[/TD]
[TD="align: right"]20[/TD]
[/TR]
[TR]
[TD]Job C[/TD]
[TD]Resource 4[/TD]
[TD="align: right"]01-Dec[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]Job C[/TD]
[TD]Resource 4[/TD]
[TD="align: right"]01-Jan[/TD]
[TD="align: right"]50[/TD]
[/TR]
[TR]
[TD]Job C[/TD]
[TD]Resource 4[/TD]
[TD="align: right"]01-Feb[/TD]
[TD="align: right"]50[/TD]
[/TR]
[TR]
[TD]Job C[/TD]
[TD]Resource 4[/TD]
[TD="align: right"]01-Mar[/TD]
[TD="align: right"]50[/TD]
[/TR]
[TR]
[TD]Job C[/TD]
[TD]Resource 4[/TD]
[TD="align: right"]01-Apr[/TD]
[TD="align: right"]50[/TD]
[/TR]
[TR]
[TD]Job C[/TD]
[TD]Resource 4[/TD]
[TD="align: right"]01-May[/TD]
[TD="align: right"]50[/TD]
[/TR]
[TR]
[TD]Job C[/TD]
[TD]Resource 4[/TD]
[TD="align: right"]01-Jun[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]Job C[/TD]
[TD]Resource 5[/TD]
[TD="align: right"]01-Dec[/TD]
[TD="align: right"]10[/TD]
[/TR]
[TR]
[TD]Job C[/TD]
[TD]Resource 5[/TD]
[TD="align: right"]01-Jan[/TD]
[TD="align: right"]10[/TD]
[/TR]
[TR]
[TD]Job C[/TD]
[TD]Resource 5[/TD]
[TD="align: right"]01-Feb[/TD]
[TD="align: right"]10[/TD]
[/TR]
[TR]
[TD]Job C[/TD]
[TD]Resource 5[/TD]
[TD="align: right"]01-Mar[/TD]
[TD="align: right"]10[/TD]
[/TR]
[TR]
[TD]Job C[/TD]
[TD]Resource 5[/TD]
[TD="align: right"]01-Apr[/TD]
[TD="align: right"]10[/TD]
[/TR]
[TR]
[TD]Job C[/TD]
[TD]Resource 5[/TD]
[TD="align: right"]01-May[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]Job C[/TD]
[TD]Resource 5[/TD]
[TD="align: right"]01-Jun[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]Job B[/TD]
[TD]Resource 6[/TD]
[TD="align: right"]01-Dec[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]Job B[/TD]
[TD]Resource 6[/TD]
[TD="align: right"]01-Jan[/TD]
[TD="align: right"]30[/TD]
[/TR]
[TR]
[TD]Job B[/TD]
[TD]Resource 6[/TD]
[TD="align: right"]01-Feb[/TD]
[TD="align: right"]30[/TD]
[/TR]
[TR]
[TD]Job B[/TD]
[TD]Resource 6[/TD]
[TD="align: right"]01-Mar[/TD]
[TD="align: right"]30[/TD]
[/TR]
[TR]
[TD]Job B[/TD]
[TD]Resource 6[/TD]
[TD="align: right"]01-Apr[/TD]
[TD="align: right"]30[/TD]
[/TR]
[TR]
[TD]Job B[/TD]
[TD]Resource 6[/TD]
[TD="align: right"]01-May[/TD]
[TD="align: right"]30[/TD]
[/TR]
[TR]
[TD]Job B[/TD]
[TD]Resource 6[/TD]
[TD="align: right"]01-Jun[/TD]
[TD="align: right"]30[/TD]
[/TR]
</tbody>[/TABLE]
I am looking for some assistance in writing a macro to transpose timespread data that is coming out of a program that I use. I need to be able to make a calculation on the data, then put it back into a pivot table to spread it again by period. I only need help getting the data from timespread to data table. See example below. The columns 1 and 2 need to be repeated for every period. The periods, will be changing every time i run the report.
Thank you for your help.
[TABLE="class: grid, width: 691"]
<colgroup><col><col><col><col><col><col span="4"><col></colgroup><tbody>[TR]
[TD]From this[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Project[/TD]
[TD]Resource[/TD]
[TD]Field[/TD]
[TD="align: right"]01-Dec[/TD]
[TD="align: right"]01-Jan[/TD]
[TD="align: right"]01-Feb[/TD]
[TD="align: right"]01-Mar[/TD]
[TD="align: right"]01-Apr[/TD]
[TD="align: right"]01-May[/TD]
[TD="align: right"]01-Jun[/TD]
[/TR]
[TR]
[TD]Job A[/TD]
[TD]Resource 1[/TD]
[TD]Hours[/TD]
[TD="align: right"]20[/TD]
[TD="align: right"]20[/TD]
[TD="align: right"]20[/TD]
[TD="align: right"]20[/TD]
[TD="align: right"]20[/TD]
[TD="align: right"]20[/TD]
[TD="align: right"]20[/TD]
[/TR]
[TR]
[TD]Job A[/TD]
[TD]Resource 2[/TD]
[TD]Hours[/TD]
[TD] [/TD]
[TD="align: right"]30[/TD]
[TD="align: right"]30[/TD]
[TD="align: right"]30[/TD]
[TD="align: right"]30[/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]Job B[/TD]
[TD]Resource 3[/TD]
[TD]Hours[/TD]
[TD] [/TD]
[TD] [/TD]
[TD="align: right"]20[/TD]
[TD="align: right"]20[/TD]
[TD="align: right"]20[/TD]
[TD="align: right"]20[/TD]
[TD="align: right"]20[/TD]
[/TR]
[TR]
[TD]Job C[/TD]
[TD]Resource 4[/TD]
[TD]Hours[/TD]
[TD] [/TD]
[TD="align: right"]50[/TD]
[TD="align: right"]50[/TD]
[TD="align: right"]50[/TD]
[TD="align: right"]50[/TD]
[TD="align: right"]50[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]Job C[/TD]
[TD]Resource 5[/TD]
[TD]Hours[/TD]
[TD="align: right"]10[/TD]
[TD="align: right"]10[/TD]
[TD="align: right"]10[/TD]
[TD="align: right"]10[/TD]
[TD="align: right"]10[/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]Job B[/TD]
[TD]Resource 6[/TD]
[TD]Hours[/TD]
[TD] [/TD]
[TD="align: right"]30[/TD]
[TD="align: right"]30[/TD]
[TD="align: right"]30[/TD]
[TD="align: right"]30[/TD]
[TD="align: right"]30[/TD]
[TD="align: right"]30[/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="class: grid, width: 289"]
<colgroup><col><col><col><col></colgroup><tbody>[TR]
[TD]Into this[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Project[/TD]
[TD]Resource[/TD]
[TD]Period[/TD]
[TD]Hours[/TD]
[/TR]
[TR]
[TD]Job A[/TD]
[TD]Resource 1[/TD]
[TD="align: right"]01-Dec[/TD]
[TD="align: right"]20[/TD]
[/TR]
[TR]
[TD]Job A[/TD]
[TD]Resource 1[/TD]
[TD="align: right"]01-Jan[/TD]
[TD="align: right"]20[/TD]
[/TR]
[TR]
[TD]Job A[/TD]
[TD]Resource 1[/TD]
[TD="align: right"]01-Feb[/TD]
[TD="align: right"]20[/TD]
[/TR]
[TR]
[TD]Job A[/TD]
[TD]Resource 1[/TD]
[TD="align: right"]01-Mar[/TD]
[TD="align: right"]20[/TD]
[/TR]
[TR]
[TD]Job A[/TD]
[TD]Resource 1[/TD]
[TD="align: right"]01-Apr[/TD]
[TD="align: right"]20[/TD]
[/TR]
[TR]
[TD]Job A[/TD]
[TD]Resource 1[/TD]
[TD="align: right"]01-May[/TD]
[TD="align: right"]20[/TD]
[/TR]
[TR]
[TD]Job A[/TD]
[TD]Resource 1[/TD]
[TD="align: right"]01-Jun[/TD]
[TD="align: right"]20[/TD]
[/TR]
[TR]
[TD]Job A[/TD]
[TD]Resource 2[/TD]
[TD="align: right"]01-Dec[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]Job A[/TD]
[TD]Resource 2[/TD]
[TD="align: right"]01-Jan[/TD]
[TD="align: right"]30[/TD]
[/TR]
[TR]
[TD]Job A[/TD]
[TD]Resource 2[/TD]
[TD="align: right"]01-Feb[/TD]
[TD="align: right"]30[/TD]
[/TR]
[TR]
[TD]Job A[/TD]
[TD]Resource 2[/TD]
[TD="align: right"]01-Mar[/TD]
[TD="align: right"]30[/TD]
[/TR]
[TR]
[TD]Job A[/TD]
[TD]Resource 2[/TD]
[TD="align: right"]01-Apr[/TD]
[TD="align: right"]30[/TD]
[/TR]
[TR]
[TD]Job A[/TD]
[TD]Resource 2[/TD]
[TD="align: right"]01-May[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]Job A[/TD]
[TD]Resource 2[/TD]
[TD="align: right"]01-Jun[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]Job B[/TD]
[TD]Resource 3[/TD]
[TD="align: right"]01-Dec[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]Job B[/TD]
[TD]Resource 3[/TD]
[TD="align: right"]01-Jan[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]Job B[/TD]
[TD]Resource 3[/TD]
[TD="align: right"]01-Feb[/TD]
[TD="align: right"]20[/TD]
[/TR]
[TR]
[TD]Job B[/TD]
[TD]Resource 3[/TD]
[TD="align: right"]01-Mar[/TD]
[TD="align: right"]20[/TD]
[/TR]
[TR]
[TD]Job B[/TD]
[TD]Resource 3[/TD]
[TD="align: right"]01-Apr[/TD]
[TD="align: right"]20[/TD]
[/TR]
[TR]
[TD]Job B[/TD]
[TD]Resource 3[/TD]
[TD="align: right"]01-May[/TD]
[TD="align: right"]20[/TD]
[/TR]
[TR]
[TD]Job B[/TD]
[TD]Resource 3[/TD]
[TD="align: right"]01-Jun[/TD]
[TD="align: right"]20[/TD]
[/TR]
[TR]
[TD]Job C[/TD]
[TD]Resource 4[/TD]
[TD="align: right"]01-Dec[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]Job C[/TD]
[TD]Resource 4[/TD]
[TD="align: right"]01-Jan[/TD]
[TD="align: right"]50[/TD]
[/TR]
[TR]
[TD]Job C[/TD]
[TD]Resource 4[/TD]
[TD="align: right"]01-Feb[/TD]
[TD="align: right"]50[/TD]
[/TR]
[TR]
[TD]Job C[/TD]
[TD]Resource 4[/TD]
[TD="align: right"]01-Mar[/TD]
[TD="align: right"]50[/TD]
[/TR]
[TR]
[TD]Job C[/TD]
[TD]Resource 4[/TD]
[TD="align: right"]01-Apr[/TD]
[TD="align: right"]50[/TD]
[/TR]
[TR]
[TD]Job C[/TD]
[TD]Resource 4[/TD]
[TD="align: right"]01-May[/TD]
[TD="align: right"]50[/TD]
[/TR]
[TR]
[TD]Job C[/TD]
[TD]Resource 4[/TD]
[TD="align: right"]01-Jun[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]Job C[/TD]
[TD]Resource 5[/TD]
[TD="align: right"]01-Dec[/TD]
[TD="align: right"]10[/TD]
[/TR]
[TR]
[TD]Job C[/TD]
[TD]Resource 5[/TD]
[TD="align: right"]01-Jan[/TD]
[TD="align: right"]10[/TD]
[/TR]
[TR]
[TD]Job C[/TD]
[TD]Resource 5[/TD]
[TD="align: right"]01-Feb[/TD]
[TD="align: right"]10[/TD]
[/TR]
[TR]
[TD]Job C[/TD]
[TD]Resource 5[/TD]
[TD="align: right"]01-Mar[/TD]
[TD="align: right"]10[/TD]
[/TR]
[TR]
[TD]Job C[/TD]
[TD]Resource 5[/TD]
[TD="align: right"]01-Apr[/TD]
[TD="align: right"]10[/TD]
[/TR]
[TR]
[TD]Job C[/TD]
[TD]Resource 5[/TD]
[TD="align: right"]01-May[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]Job C[/TD]
[TD]Resource 5[/TD]
[TD="align: right"]01-Jun[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]Job B[/TD]
[TD]Resource 6[/TD]
[TD="align: right"]01-Dec[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]Job B[/TD]
[TD]Resource 6[/TD]
[TD="align: right"]01-Jan[/TD]
[TD="align: right"]30[/TD]
[/TR]
[TR]
[TD]Job B[/TD]
[TD]Resource 6[/TD]
[TD="align: right"]01-Feb[/TD]
[TD="align: right"]30[/TD]
[/TR]
[TR]
[TD]Job B[/TD]
[TD]Resource 6[/TD]
[TD="align: right"]01-Mar[/TD]
[TD="align: right"]30[/TD]
[/TR]
[TR]
[TD]Job B[/TD]
[TD]Resource 6[/TD]
[TD="align: right"]01-Apr[/TD]
[TD="align: right"]30[/TD]
[/TR]
[TR]
[TD]Job B[/TD]
[TD]Resource 6[/TD]
[TD="align: right"]01-May[/TD]
[TD="align: right"]30[/TD]
[/TR]
[TR]
[TD]Job B[/TD]
[TD]Resource 6[/TD]
[TD="align: right"]01-Jun[/TD]
[TD="align: right"]30[/TD]
[/TR]
</tbody>[/TABLE]