Count items in single Key of Dictionary

User avatar
sal21
PlatinumLounger
Posts: 4357
Joined: 26 Apr 2010, 17:36

Count items in single Key of Dictionary

Post by sal21 »

Attached my sheet with values for test, in modulo1 the vba code.
During the for next loop of key and items i need the count items of a single Key... in column F. (in column G wath i need)
How to?
You do not have the required permissions to view the files attached to this post.

User avatar
HansV
Administrator
Posts: 78512
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Count items in single Key of Dictionary

Post by HansV »

Why don't you use a pivot table? It displays exactly what you want, and it can be created using VBA, if you really want (you can record the macro).
See the attached version.
Cartel1.xls
You do not have the required permissions to view the files attached to this post.
Best wishes,
Hans

User avatar
sal21
PlatinumLounger
Posts: 4357
Joined: 26 Apr 2010, 17:36

Re: Count items in single Key of Dictionary

Post by sal21 »

HansV wrote:Why don't you use a pivot table? It displays exactly what you want, and it can be created using VBA, if you really want (you can record the macro).
See the attached version.
Cartel1.xls
Tks for example but need to fill a variable:-(

User avatar
HansV
Administrator
Posts: 78512
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Count items in single Key of Dictionary

Post by HansV »

You can read the values from the pivot table.
Best wishes,
Hans