Excel Macros

tarunshrivastava01

New Member
Joined
Apr 19, 2014
Messages
1
I am having excel sheet with huge data. I want the vb macros to take out the unique count of Column 'Computer Name' by filtering the column 'Location'. Like:

Row1
Computer Name

<colgroup><col width="125"></colgroup><tbody>
</tbody>
Something

<colgroup><col width="125"></colgroup><tbody>
</tbody>
Something

<colgroup><col width="125"></colgroup><tbody>
</tbody>
Something

<colgroup><col width="125"></colgroup><tbody>
</tbody>
Location

<colgroup><col width="125"></colgroup><tbody>
</tbody>

<colgroup><col width="125"></colgroup><tbody>Row2
</tbody>
Desktop1

<colgroup><col width="125"></colgroup><tbody>
</tbody>
India
Row3

<colgroup><col width="125"></colgroup><tbody>
</tbody>
Desktop2

<colgroup><col width="125"></colgroup><tbody>
</tbody>
India
Row4

<colgroup><col width="125"></colgroup><tbody>
</tbody>
Desktop3

<colgroup><col width="125"></colgroup><tbody>
</tbody>
India

<colgroup><col width="125"></colgroup><tbody>
Row5

</tbody>
Desktop1

<colgroup><col width="125"></colgroup><tbody>
</tbody>
India
Row6
Desktop3

<colgroup><col width="125"></colgroup><tbody>
</tbody>
India
Row7
Desktop11

<colgroup><col width="125"></colgroup><tbody>
</tbody>
China
Row8
Desktop12

<colgroup><col width="125"></colgroup><tbody>
</tbody>
China
Row9
Desktop13

<colgroup><col width="125"></colgroup><tbody>
</tbody>
China
Row10
Desktop11

<colgroup><col width="125"></colgroup><tbody>
</tbody>
China
Row11
Desktop13

<colgroup><col width="125"></colgroup><tbody>
</tbody>
China
Row12
Row13

<tbody>
</tbody>


First it look for India (Column 'Location') and take the unique count for Column 'Computer Name' from row2 to row6 means filtering by India in column 'Location' i.e., Unique count = 3(Desktop1-3) and then look for Column 'Location' China and take the unique count for column 'Computer Name' from row6-row10.
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying

Forum statistics

Threads
1,217,363
Messages
6,136,109
Members
449,993
Latest member
Sphere2215

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top