Hi,
I need to transform a raw extract into a new sheet for a pivot source. The raw extract has transactional information + check-in and check-out as shown below:
[TABLE="width: 728"]
<colgroup><col><col span="2"><col><col><col><col></colgroup><tbody>[TR]
[TD]LISTING'S NICKNAME[/TD]
[TD]CHECK OUT[/TD]
[TD]CHECK IN[/TD]
[TD]SOURCE[/TD]
[TD]ΣTOTAL PAYOUT[/TD]
[TD]ΣNUMBER OF NIGHTS[/TD]
[TD]ΣTOTAL REFUNDED[/TD]
[/TR]
[TR]
[TD]BL031[/TD]
[TD]12/19/2018[/TD]
[TD]12/14/2018[/TD]
[TD]Booking.com[/TD]
[TD="align: right"]£1 495[/TD]
[TD="align: right"]5[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]BL032[/TD]
[TD]12/19/2018[/TD]
[TD]12/14/2018[/TD]
[TD]Booking.com[/TD]
[TD="align: right"]£1 495[/TD]
[TD="align: right"]5[/TD]
[TD] £100[/TD]
[/TR]
[TR]
[TD]BL031[/TD]
[TD]01/23/2019[/TD]
[TD="align: right"]01/09/2019[/TD]
[TD]Booking.com[/TD]
[TD="align: right"]£4 060[/TD]
[TD="align: right"]14[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Objective > create a macro that create a new table in a new sheet .
The new table should have 28 rows ( 5 + 5 + 14) with:
(1) an additional colum DATE with the actual date of each stay and;
(2) an new column Average Price = (Total Payout - Total Refunded) / Number of Nights.
I guess I need a For loop but don't have the competency to write this code. I guess it should go like this:
For each row in range, consider that check in date and create a new row until check out date.
Many thanks for your help.
Bless,
Matt
I need to transform a raw extract into a new sheet for a pivot source. The raw extract has transactional information + check-in and check-out as shown below:
[TABLE="width: 728"]
<colgroup><col><col span="2"><col><col><col><col></colgroup><tbody>[TR]
[TD]LISTING'S NICKNAME[/TD]
[TD]CHECK OUT[/TD]
[TD]CHECK IN[/TD]
[TD]SOURCE[/TD]
[TD]ΣTOTAL PAYOUT[/TD]
[TD]ΣNUMBER OF NIGHTS[/TD]
[TD]ΣTOTAL REFUNDED[/TD]
[/TR]
[TR]
[TD]BL031[/TD]
[TD]12/19/2018[/TD]
[TD]12/14/2018[/TD]
[TD]Booking.com[/TD]
[TD="align: right"]£1 495[/TD]
[TD="align: right"]5[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]BL032[/TD]
[TD]12/19/2018[/TD]
[TD]12/14/2018[/TD]
[TD]Booking.com[/TD]
[TD="align: right"]£1 495[/TD]
[TD="align: right"]5[/TD]
[TD] £100[/TD]
[/TR]
[TR]
[TD]BL031[/TD]
[TD]01/23/2019[/TD]
[TD="align: right"]01/09/2019[/TD]
[TD]Booking.com[/TD]
[TD="align: right"]£4 060[/TD]
[TD="align: right"]14[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Objective > create a macro that create a new table in a new sheet .
The new table should have 28 rows ( 5 + 5 + 14) with:
(1) an additional colum DATE with the actual date of each stay and;
(2) an new column Average Price = (Total Payout - Total Refunded) / Number of Nights.
I guess I need a For loop but don't have the competency to write this code. I guess it should go like this:
For each row in range, consider that check in date and create a new row until check out date.
Many thanks for your help.
Bless,
Matt