Hello
I am new in VBA and I am looking to build a macro to count the number of stores a responsible (let's say K) sells to, for each brand.
In this example, K sells to 1 store the brand 1 and 1 store the brand 2. (so a total of 3 sales but to 2 stores only).
Any help would be really appreciated
Thanks
[TABLE="width: 500"]
<tbody>[TR]
[TD]
[TABLE="width: 147"]
<colgroup><col></colgroup><tbody>[TR]
[TD]Responsible[/TD]
[/TR]
[TR]
[TD]K[/TD]
[/TR]
[TR]
[TD]K[/TD]
[/TR]
[TR]
[TD]K[/TD]
[/TR]
[TR]
[TD]B[/TD]
[/TR]
[TR]
[TD]B[/TD]
[/TR]
[TR]
[TD]B[/TD]
[/TR]
[TR]
[TD]B[/TD]
[/TR]
[TR]
[TD]B[/TD]
[/TR]
[TR]
[TD]S[/TD]
[/TR]
[TR]
[TD]S[/TD]
[/TR]
[TR]
[TD]S[/TD]
[/TR]
[TR]
[TD]S[/TD]
[/TR]
[TR]
[TD]B[/TD]
[/TR]
[TR]
[TD]B[/TD]
[/TR]
[TR]
[TD]B[/TD]
[/TR]
[TR]
[TD]B[/TD]
[/TR]
[TR]
[TD]B[/TD]
[/TR]
[TR]
[TD]B[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 306"]
<colgroup><col></colgroup><tbody>[TR]
[TD]Store Name[/TD]
[/TR]
[TR]
[TD] TWCM Unley[/TD]
[/TR]
[TR]
[TD] HealthSave Stirling[/TD]
[/TR]
[TR]
[TD] HealthSave Stirling[/TD]
[/TR]
[TR]
[TD]Pharmacy 360 Black Rock[/TD]
[/TR]
[TR]
[TD]Mulqueeny Midnight Pharmacy[/TD]
[/TR]
[TR]
[TD]Alfred Healthsmart [/TD]
[/TR]
[TR]
[TD]Ramsay CBD [/TD]
[/TR]
[TR]
[TD]Scott Dibben[/TD]
[/TR]
[TR]
[TD]SP Pitt St[/TD]
[/TR]
[TR]
[TD]PL George St[/TD]
[/TR]
[TR]
[TD]PL George St[/TD]
[/TR]
[TR]
[TD]TW Chatswood Chase[/TD]
[/TR]
[TR]
[TD]CWH Chatswood[/TD]
[/TR]
[TR]
[TD]PL Wynard[/TD]
[/TR]
[TR]
[TD]PL World Square[/TD]
[/TR]
[TR]
[TD]PL World Square[/TD]
[/TR]
[TR]
[TD]SP Pitt Street[/TD]
[/TR]
[TR]
[TD]SP Pitt Street[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 56"]
<colgroup><col></colgroup><tbody>[TR]
[TD]Brand[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD="align: right"]2[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
I am new in VBA and I am looking to build a macro to count the number of stores a responsible (let's say K) sells to, for each brand.
In this example, K sells to 1 store the brand 1 and 1 store the brand 2. (so a total of 3 sales but to 2 stores only).
Any help would be really appreciated
Thanks
[TABLE="width: 500"]
<tbody>[TR]
[TD]
[TABLE="width: 147"]
<colgroup><col></colgroup><tbody>[TR]
[TD]Responsible[/TD]
[/TR]
[TR]
[TD]K[/TD]
[/TR]
[TR]
[TD]K[/TD]
[/TR]
[TR]
[TD]K[/TD]
[/TR]
[TR]
[TD]B[/TD]
[/TR]
[TR]
[TD]B[/TD]
[/TR]
[TR]
[TD]B[/TD]
[/TR]
[TR]
[TD]B[/TD]
[/TR]
[TR]
[TD]B[/TD]
[/TR]
[TR]
[TD]S[/TD]
[/TR]
[TR]
[TD]S[/TD]
[/TR]
[TR]
[TD]S[/TD]
[/TR]
[TR]
[TD]S[/TD]
[/TR]
[TR]
[TD]B[/TD]
[/TR]
[TR]
[TD]B[/TD]
[/TR]
[TR]
[TD]B[/TD]
[/TR]
[TR]
[TD]B[/TD]
[/TR]
[TR]
[TD]B[/TD]
[/TR]
[TR]
[TD]B[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 306"]
<colgroup><col></colgroup><tbody>[TR]
[TD]Store Name[/TD]
[/TR]
[TR]
[TD] TWCM Unley[/TD]
[/TR]
[TR]
[TD] HealthSave Stirling[/TD]
[/TR]
[TR]
[TD] HealthSave Stirling[/TD]
[/TR]
[TR]
[TD]Pharmacy 360 Black Rock[/TD]
[/TR]
[TR]
[TD]Mulqueeny Midnight Pharmacy[/TD]
[/TR]
[TR]
[TD]Alfred Healthsmart [/TD]
[/TR]
[TR]
[TD]Ramsay CBD [/TD]
[/TR]
[TR]
[TD]Scott Dibben[/TD]
[/TR]
[TR]
[TD]SP Pitt St[/TD]
[/TR]
[TR]
[TD]PL George St[/TD]
[/TR]
[TR]
[TD]PL George St[/TD]
[/TR]
[TR]
[TD]TW Chatswood Chase[/TD]
[/TR]
[TR]
[TD]CWH Chatswood[/TD]
[/TR]
[TR]
[TD]PL Wynard[/TD]
[/TR]
[TR]
[TD]PL World Square[/TD]
[/TR]
[TR]
[TD]PL World Square[/TD]
[/TR]
[TR]
[TD]SP Pitt Street[/TD]
[/TR]
[TR]
[TD]SP Pitt Street[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 56"]
<colgroup><col></colgroup><tbody>[TR]
[TD]Brand[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD="align: right"]2[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]