I have searched and found a number of similar questions (here and elsewhere) but I can't get my head around how to adapt to my needs. Usually I find pivot like Pivot data using VBA and either I can't figure out how to properly search for (describe) what I need, or I am missing something.
I get the data (up to 30K rows) of Subject/Category pairs and count/group them to get:
Subject Category Count
A C1 1
A C2 4
B C1 8
B C2 1
B C3 2
C C2 4
I need the data to appear as
Subject C1 C2 C3
A 1 4 0
B 8 1 2
C 0 4 0
Is there a way to achieve this using Excel VBA? I tried going directly to this format from the raw data, but couldn't figure that out, so was hoping this way would work better.
Any help would be immensely appreciated--even if it's to tell me how to search for solutions to this better.
EDIT: Oh yeah, and the list of Categories is not the same on each run of this data. Has to be done regularly, and will change from one time to the next. So I was looking to figure out how to grow the Categories from left to right as they appear (then I can always sort them afterwards)...