Hello good people.
I've attached a sample file. There is some code in the sample file in Module 1.
Main issue here is selecting multiple cells for grouping, but the number of cells changes each time.
I have a reference sheet which contains "Long descriptions". These values are contained in the pivottable.
In the adjacent column, I type in the "short description".
The "short description" is NOT unique to each long description i.e. it applies to more than one line.
This can differ each month
eg. in current month, there could be 3 Long Descrip that fall under Short Descrip1.
Next month, there could be 5 Long Descrip that fall under the Short Descrip1.
The macro code in Module 1 goes to the pivottable, and brings back the row reference on which the LongDescrip appears.
From this point onwards, I am failing.
I need the macro to go back to the pivottable, select all items under ShortDescrip1, group these items, then rename the group to ShortDescrip1.
It should do this for all the short descriptions.
I've put in a table of what the desired result looks like.
Pretty easy to understand when you see the sample file.
I tried Union function but can't seem to get it to work because the number of items falling under a Short Descrip keeps changing each month, thus changing the number of expressions to include in the multiple selection.
Bookmarks