ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   vba - counting different items (https://www.excelbanter.com/excel-programming/306813-vba-counting-different-items.html)

abc2002

vba - counting different items
 
Hi

I need to know how many different variables for each day

Range A1:A4 contains
2004-08-01
2004-08-01
2004-08-01
2004-08-02

Range B1:B4 contains
abc
bbb
abc
ccc

In VBA, how can I get that?

I should get:
2004-08-01 - 2
2004-08-02 - 1

thanks


---
Message posted from http://www.ExcelForum.com/


Tom Ogilvy

vba - counting different items
 
If you don't mind putting the results on the worksheet, you can use the
Advanced filter using the Unique setting. Turn on the recorder while you do
it manually to get the code.

--
Regards,
Tom Ogilvy


"abc2002 " wrote in message
...
Hi

I need to know how many different variables for each day

Range A1:A4 contains
2004-08-01
2004-08-01
2004-08-01
2004-08-02

Range B1:B4 contains
abc
bbb
abc
ccc

In VBA, how can I get that?

I should get:
2004-08-01 - 2
2004-08-02 - 1

thanks


---
Message posted from http://www.ExcelForum.com/




Stephen Rasey[_2_]

vba - counting different items
 
Does it have to be VBA?

An Advanced Filter that extracts Date and Variable, Copy to New Location,
Unique Rows will eliminate all duplicates.

Then a Pivot table can count by date.

Stephen Rasey
WiserWays, LLC
Houston
http://excelsig.org


"abc2002 " wrote in message
...
Hi

I need to know how many different variables for each day

Range A1:A4 contains
2004-08-01
2004-08-01
2004-08-01
2004-08-02

Range B1:B4 contains
abc
bbb
abc
ccc

In VBA, how can I get that?

I should get:
2004-08-01 - 2
2004-08-02 - 1

thanks


---
Message posted from http://www.ExcelForum.com/





All times are GMT +1. The time now is 06:26 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com