I'm not aware of any shapesheet functionality to do that. Nor am I aware of a code accessible function. But, with code, you could sort thru shapes to see if your criteria is met, then check if that shape is part of group, if so, subgroup it. Maybe some of other members have alternative solutions.