How do I sort multiple Shapes by a Custom Name Field?

Started by OzzyMoto, February 26, 2013, 12:31:26 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

OzzyMoto

I have linked hundreds of shapes to an excel spreadsheet and would like the ability to sort them (left-to-right) based on a custom 'Name' (Prop.VisDM_Name) field - is this possible?

Here is an image of the unsorted shapes (MNEPPKI02-D should be in the left-most position followed by MNEPSQL01-D and MNEPWEB06-D).

Thank you!


Jumpy

In VBA I would create a custom record (in VBA it's "Type") containing the Name (value in Prop.VisDM_Name) and the ID of the shape. I would loop through all the shapes on the page and store name and Id in a record and the record in an array of records or a collection or sth. similiar. Then I would sort that array/collection using a sort algorythm. Then I would loop through the sorted array/collection and place each shape as desired, identifying each shape with the stored id in the record.