Hi VBA experts!
I’m a vba greenhorn and got a –in my opinion- complex problem.
First of all: I need a makro solution, even if the Pivot table does some of the following steps
Now to the Problem:
In one column i got some dates in the format DD.MM.JJJJ and in the other one some terms such as „screwdriver“, „tire“ ,... for example.
I now need a vba code, that counts the frequency of terms per year and sum up the four largest ones for every year.
With a little help i solved the first part of the problem by using a dictionary.
So i got an output like this
A / B / C
2009/ screwdriver/ 4
2009/Tire/ 3
2009/ pencil / 7
2009/ ball / 9
2009/skateboard/2
.
.
2010/tire/2
...
In this example case there are 4+3+7+9+2=25 terms for 2009. The sum of the largest four is 9+7+4+3=23.
And now I want an output like
D / E
2009/23
How can sum up only a part of my dictionary?
Maybe I need a complete different method?
I hope you understand the problem and can help me to solve this!
The attached file contains the data in Table1 and my Dictionary Output in Table2.
Bookmarks