Hi to everyone, i would to create a vba code so that to count the col "A" by "Terms of Stay" and "SUM in col. "B" for each type its accommodation as my below example. In schedule 1. are the original data and in schedule 2. is the expected result.
Many thanks in advance
Schedule 1.
<colgroup><col style="mso-width-source:userset;mso-width-alt:3474;width:71pt" width="95"> <col style="mso-width-source:userset;mso-width-alt:3949;width:81pt" width="108"> </colgroup><tbody>
[TD="width: 95"]Terms Stay[/TD]
[TD="width: 108"]Accomodation[/TD]
[TD="align: right"]1262[/TD]
[TD="align: right"]342[/TD]
[TD="align: right"]1400[/TD]
[TD="align: right"]855[/TD]
[TD="align: right"]957[/TD]
[TD="align: right"]1262[/TD]
[TD="align: right"]2304[/TD]
[TD="align: right"]342[/TD]
[TD="align: right"]1970[/TD]
[TD="align: right"]546[/TD]
[TD="align: right"]1274[/TD]
[TD="align: right"]1945[/TD]
[TD="align: right"]2025[/TD]
</tbody>
Schedule 2.
<colgroup><col style="mso-width-source:userset;mso-width-alt:3474;width:71pt" width="95"> <col style="mso-width-source:userset;mso-width-alt:3949;width:81pt" width="108"> </colgroup><tbody>
[TD="width: 95"]Terms Stay[/TD]
[TD="width: 108"]Accomodation[/TD]
[TD="class: xl65"]A/P 3 RMS[/TD]
[TD="align: right"]3004[/TD]
[TD="class: xl65"]B/B 2 RMS[/TD]
[TD="align: right"]1812[/TD]
[TD="class: xl65"]H/B 6 RMS[/TD]
[TD="align: right"]7698[/TD]
[TD="class: xl65"]O/T 2 RMS[/TD]
[TD="align: right"]3970[/TD]
</tbody>
Many thanks in advance
Schedule 1.
A/P |
A/P |
A/P |
B/B |
B/B |
H/B |
H/B |
H/B |
H/B |
H/B |
H/B |
O/T |
O/T |
<colgroup><col style="mso-width-source:userset;mso-width-alt:3474;width:71pt" width="95"> <col style="mso-width-source:userset;mso-width-alt:3949;width:81pt" width="108"> </colgroup><tbody>
[TD="width: 95"]Terms Stay[/TD]
[TD="width: 108"]Accomodation[/TD]
[TD="align: right"]1262[/TD]
[TD="align: right"]342[/TD]
[TD="align: right"]1400[/TD]
[TD="align: right"]855[/TD]
[TD="align: right"]957[/TD]
[TD="align: right"]1262[/TD]
[TD="align: right"]2304[/TD]
[TD="align: right"]342[/TD]
[TD="align: right"]1970[/TD]
[TD="align: right"]546[/TD]
[TD="align: right"]1274[/TD]
[TD="align: right"]1945[/TD]
[TD="align: right"]2025[/TD]
</tbody>
Schedule 2.
<colgroup><col style="mso-width-source:userset;mso-width-alt:3474;width:71pt" width="95"> <col style="mso-width-source:userset;mso-width-alt:3949;width:81pt" width="108"> </colgroup><tbody>
[TD="width: 95"]Terms Stay[/TD]
[TD="width: 108"]Accomodation[/TD]
[TD="class: xl65"]A/P 3 RMS[/TD]
[TD="align: right"]3004[/TD]
[TD="class: xl65"]B/B 2 RMS[/TD]
[TD="align: right"]1812[/TD]
[TD="class: xl65"]H/B 6 RMS[/TD]
[TD="align: right"]7698[/TD]
[TD="class: xl65"]O/T 2 RMS[/TD]
[TD="align: right"]3970[/TD]
</tbody>