PDA

View Full Version : Macro to group rows



susiewilson0
01-28-2013, 11:49 AM
Hello!

I'm trying to build a macro for a dynamic hierarchy structure that groups rows based on cell content. The attachment is a mock of what the larger file looks like, the first tab without grouped rows, and the second tab showing the desired output. Unfortunately, I can't just group until it gets to the next parent down because sometimes there are rows with detail between two parents that needs to not be included. The only true statement I can come up with is that I need to group rows starting at a parent value and "group all rows below it when there is cell content down at least one row and to the right of the parent value until it reaches the next parent value in the same column as the first parent value, but only group the rows in that range that actually have cell contents." Some rows in that range would not have cell contents to the right of the original parent value, maybe only to the left, and would therefore need to not be included. Any help would be MORE than appreciated...!!

Thank you,
Susie