Hello Excel users,
i am trying to create a macro where i can repeat rows based on from and to date columns.
So is there any way using for loop which can get the below desired output in csv by using macro?
INPUT from excel sheet
[TABLE="width: 500"]
<tbody>[TR]
[TD]From[/TD]
[TD]To[/TD]
[TD]Product[/TD]
[TD]Growth[/TD]
[/TR]
[TR]
[TD]19-09-2018[/TD]
[TD]25-09-2018[/TD]
[TD]A[/TD]
[TD]2%[/TD]
[/TR]
[TR]
[TD]23-09-2018[/TD]
[TD]27-09-2018[/TD]
[TD]B[/TD]
[TD]3%[/TD]
[/TR]
</tbody>[/TABLE]
Expected Output in CSV
[TABLE="width: 500"]
<tbody>[TR]
[TD]Date[/TD]
[TD]Product[/TD]
[TD]Growth[/TD]
[/TR]
[TR]
[TD]19-09-2018[/TD]
[TD]A[/TD]
[TD]2%[/TD]
[/TR]
[TR]
[TD]20-09-2018[/TD]
[TD]A[/TD]
[TD]2%[/TD]
[/TR]
[TR]
[TD]21-09-2018[/TD]
[TD]A[/TD]
[TD]2%[/TD]
[/TR]
[TR]
[TD]22-09-2018[/TD]
[TD]A[/TD]
[TD]2%[/TD]
[/TR]
[TR]
[TD]23-09-2018[/TD]
[TD]A[/TD]
[TD]2%[/TD]
[/TR]
[TR]
[TD]24-09-2018[/TD]
[TD]A[/TD]
[TD]2%[/TD]
[/TR]
[TR]
[TD]25-09-2018[/TD]
[TD]A[/TD]
[TD]2%[/TD]
[/TR]
[TR]
[TD]23-09-2018[/TD]
[TD]B[/TD]
[TD]3%[/TD]
[/TR]
[TR]
[TD]24-09-2018[/TD]
[TD]B[/TD]
[TD]3%[/TD]
[/TR]
[TR]
[TD]25-09-2018[/TD]
[TD]B[/TD]
[TD]3%[/TD]
[/TR]
[TR]
[TD]26-09-2018[/TD]
[TD]B[/TD]
[TD]3%[/TD]
[/TR]
[TR]
[TD]27-09-2018[/TD]
[TD]B[/TD]
[TD]3%[/TD]
[/TR]
</tbody>[/TABLE]
Thanks a lot
i am trying to create a macro where i can repeat rows based on from and to date columns.
So is there any way using for loop which can get the below desired output in csv by using macro?
INPUT from excel sheet
[TABLE="width: 500"]
<tbody>[TR]
[TD]From[/TD]
[TD]To[/TD]
[TD]Product[/TD]
[TD]Growth[/TD]
[/TR]
[TR]
[TD]19-09-2018[/TD]
[TD]25-09-2018[/TD]
[TD]A[/TD]
[TD]2%[/TD]
[/TR]
[TR]
[TD]23-09-2018[/TD]
[TD]27-09-2018[/TD]
[TD]B[/TD]
[TD]3%[/TD]
[/TR]
</tbody>[/TABLE]
Expected Output in CSV
[TABLE="width: 500"]
<tbody>[TR]
[TD]Date[/TD]
[TD]Product[/TD]
[TD]Growth[/TD]
[/TR]
[TR]
[TD]19-09-2018[/TD]
[TD]A[/TD]
[TD]2%[/TD]
[/TR]
[TR]
[TD]20-09-2018[/TD]
[TD]A[/TD]
[TD]2%[/TD]
[/TR]
[TR]
[TD]21-09-2018[/TD]
[TD]A[/TD]
[TD]2%[/TD]
[/TR]
[TR]
[TD]22-09-2018[/TD]
[TD]A[/TD]
[TD]2%[/TD]
[/TR]
[TR]
[TD]23-09-2018[/TD]
[TD]A[/TD]
[TD]2%[/TD]
[/TR]
[TR]
[TD]24-09-2018[/TD]
[TD]A[/TD]
[TD]2%[/TD]
[/TR]
[TR]
[TD]25-09-2018[/TD]
[TD]A[/TD]
[TD]2%[/TD]
[/TR]
[TR]
[TD]23-09-2018[/TD]
[TD]B[/TD]
[TD]3%[/TD]
[/TR]
[TR]
[TD]24-09-2018[/TD]
[TD]B[/TD]
[TD]3%[/TD]
[/TR]
[TR]
[TD]25-09-2018[/TD]
[TD]B[/TD]
[TD]3%[/TD]
[/TR]
[TR]
[TD]26-09-2018[/TD]
[TD]B[/TD]
[TD]3%[/TD]
[/TR]
[TR]
[TD]27-09-2018[/TD]
[TD]B[/TD]
[TD]3%[/TD]
[/TR]
</tbody>[/TABLE]
Thanks a lot