Hi
I want to transform some data into a table on a new sheet but to me it seems complicated so I am not sure if it is possible. Below is the source data format
[TABLE="width: 1322"]
<colgroup><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col span="2"></colgroup><tbody>[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]01/01/2014[/TD]
[TD] 01/02/2014 [/TD]
[TD]01/03/2014[/TD]
[TD] 01/04/2014 [/TD]
[TD]01/05/2014 [/TD]
[TD]01/06/2014 [/TD]
[TD]01/07/2014 [/TD]
[TD]01/08/2014 [/TD]
[TD]01/09/2014 [/TD]
[TD]01/10/2014 [/TD]
[TD]01/11/2014 [/TD]
[TD]01/12/2014[/TD]
[/TR]
[TR]
[TD]Column A[/TD]
[TD]Column B[/TD]
[TD]Column C[/TD]
[TD]Column D[/TD]
[TD]Jan-14[/TD]
[TD]Feb-14[/TD]
[TD]Mar-14[/TD]
[TD]Apr-14[/TD]
[TD]May-14[/TD]
[TD]Jun-14[/TD]
[TD]Jul-14[/TD]
[TD]Aug-14[/TD]
[TD]Sep-14[/TD]
[TD]Oct-14[/TD]
[TD]Nov-14[/TD]
[TD]Dec-14[/TD]
[/TR]
[TR]
[TD]Customer A[/TD]
[TD]50%[/TD]
[TD] [/TD]
[TD]DM[/TD]
[TD]£1,000[/TD]
[TD]£1,000[/TD]
[TD]£1,000[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]Customer B[/TD]
[TD]150%[/TD]
[TD] [/TD]
[TD]DM[/TD]
[TD][/TD]
[TD][/TD]
[TD]£1,000[/TD]
[TD]£1,000[/TD]
[TD]£1,000[/TD]
[TD]£1,000[/TD]
[TD]£1,000[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
</tbody>[/TABLE]
I want the script to work down column A and for every entry go along the row and transform the data into the following format.
[TABLE="width: 525"]
<colgroup><col><col><col><col><col><col></colgroup><tbody>[TR]
[TD]Column A[/TD]
[TD]Column B[/TD]
[TD]Column C[/TD]
[TD]Column D[/TD]
[TD]Value[/TD]
[TD]Date[/TD]
[/TR]
[TR]
[TD]Customer A[/TD]
[TD]50%[/TD]
[TD] [/TD]
[TD]DM[/TD]
[TD]£1,000[/TD]
[TD]01/01/2014[/TD]
[/TR]
[TR]
[TD]Customer A[/TD]
[TD]50%[/TD]
[TD] [/TD]
[TD]DM[/TD]
[TD]£1,000[/TD]
[TD]01/02/2014[/TD]
[/TR]
[TR]
[TD]Customer A[/TD]
[TD]50%[/TD]
[TD] [/TD]
[TD]DM[/TD]
[TD]£1,000[/TD]
[TD]01/03/2014[/TD]
[/TR]
[TR]
[TD]Customer B[/TD]
[TD]150%[/TD]
[TD] [/TD]
[TD]DM[/TD]
[TD]£1,000[/TD]
[TD]01/03/2014[/TD]
[/TR]
[TR]
[TD]Customer B[/TD]
[TD]150%[/TD]
[TD] [/TD]
[TD]DM[/TD]
[TD]£1,000[/TD]
[TD]01/04/2014[/TD]
[/TR]
[TR]
[TD]Customer B[/TD]
[TD]150%[/TD]
[TD] [/TD]
[TD]DM[/TD]
[TD]£1,000[/TD]
[TD]01/05/2014[/TD]
[/TR]
[TR]
[TD]Customer B[/TD]
[TD]150%[/TD]
[TD] [/TD]
[TD]DM[/TD]
[TD]£1,000[/TD]
[TD]01/06/2014[/TD]
[/TR]
[TR]
[TD]Customer B[/TD]
[TD]150%[/TD]
[TD] [/TD]
[TD]DM[/TD]
[TD]£1,000[/TD]
[TD]01/07/2014
[/TD]
[/TR]
</tbody>[/TABLE]
The number of rows in the new column should = the number of values there are against Dates. The first 4 columns are copied across and then repeated for each date that has a value. For each customer there can be up to 12 rows for the 12 months of the year.
Can anyone help, thanks.
Kerry
I want to transform some data into a table on a new sheet but to me it seems complicated so I am not sure if it is possible. Below is the source data format
[TABLE="width: 1322"]
<colgroup><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col span="2"></colgroup><tbody>[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]01/01/2014[/TD]
[TD] 01/02/2014 [/TD]
[TD]01/03/2014[/TD]
[TD] 01/04/2014 [/TD]
[TD]01/05/2014 [/TD]
[TD]01/06/2014 [/TD]
[TD]01/07/2014 [/TD]
[TD]01/08/2014 [/TD]
[TD]01/09/2014 [/TD]
[TD]01/10/2014 [/TD]
[TD]01/11/2014 [/TD]
[TD]01/12/2014[/TD]
[/TR]
[TR]
[TD]Column A[/TD]
[TD]Column B[/TD]
[TD]Column C[/TD]
[TD]Column D[/TD]
[TD]Jan-14[/TD]
[TD]Feb-14[/TD]
[TD]Mar-14[/TD]
[TD]Apr-14[/TD]
[TD]May-14[/TD]
[TD]Jun-14[/TD]
[TD]Jul-14[/TD]
[TD]Aug-14[/TD]
[TD]Sep-14[/TD]
[TD]Oct-14[/TD]
[TD]Nov-14[/TD]
[TD]Dec-14[/TD]
[/TR]
[TR]
[TD]Customer A[/TD]
[TD]50%[/TD]
[TD] [/TD]
[TD]DM[/TD]
[TD]£1,000[/TD]
[TD]£1,000[/TD]
[TD]£1,000[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]Customer B[/TD]
[TD]150%[/TD]
[TD] [/TD]
[TD]DM[/TD]
[TD][/TD]
[TD][/TD]
[TD]£1,000[/TD]
[TD]£1,000[/TD]
[TD]£1,000[/TD]
[TD]£1,000[/TD]
[TD]£1,000[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
</tbody>[/TABLE]
I want the script to work down column A and for every entry go along the row and transform the data into the following format.
[TABLE="width: 525"]
<colgroup><col><col><col><col><col><col></colgroup><tbody>[TR]
[TD]Column A[/TD]
[TD]Column B[/TD]
[TD]Column C[/TD]
[TD]Column D[/TD]
[TD]Value[/TD]
[TD]Date[/TD]
[/TR]
[TR]
[TD]Customer A[/TD]
[TD]50%[/TD]
[TD] [/TD]
[TD]DM[/TD]
[TD]£1,000[/TD]
[TD]01/01/2014[/TD]
[/TR]
[TR]
[TD]Customer A[/TD]
[TD]50%[/TD]
[TD] [/TD]
[TD]DM[/TD]
[TD]£1,000[/TD]
[TD]01/02/2014[/TD]
[/TR]
[TR]
[TD]Customer A[/TD]
[TD]50%[/TD]
[TD] [/TD]
[TD]DM[/TD]
[TD]£1,000[/TD]
[TD]01/03/2014[/TD]
[/TR]
[TR]
[TD]Customer B[/TD]
[TD]150%[/TD]
[TD] [/TD]
[TD]DM[/TD]
[TD]£1,000[/TD]
[TD]01/03/2014[/TD]
[/TR]
[TR]
[TD]Customer B[/TD]
[TD]150%[/TD]
[TD] [/TD]
[TD]DM[/TD]
[TD]£1,000[/TD]
[TD]01/04/2014[/TD]
[/TR]
[TR]
[TD]Customer B[/TD]
[TD]150%[/TD]
[TD] [/TD]
[TD]DM[/TD]
[TD]£1,000[/TD]
[TD]01/05/2014[/TD]
[/TR]
[TR]
[TD]Customer B[/TD]
[TD]150%[/TD]
[TD] [/TD]
[TD]DM[/TD]
[TD]£1,000[/TD]
[TD]01/06/2014[/TD]
[/TR]
[TR]
[TD]Customer B[/TD]
[TD]150%[/TD]
[TD] [/TD]
[TD]DM[/TD]
[TD]£1,000[/TD]
[TD]01/07/2014
[/TD]
[/TR]
</tbody>[/TABLE]
The number of rows in the new column should = the number of values there are against Dates. The first 4 columns are copied across and then repeated for each date that has a value. For each customer there can be up to 12 rows for the 12 months of the year.
Can anyone help, thanks.
Kerry