Sorting of values is a quite common programming task. VBA has no native sorting method. You can use algorithms like QuickSort to sort the array in place. However, there is another, maybe easier way how to sort your data without using algorithms.
Selection sets are nice CATIA feature to group and store selected elements of any type. They are pretty well described in V5Automation reference. The purpose of the methods of a SelectionSets object like CreateSelectionSet, DeleteSelectionSet or RenameSelectionSet is quite obvious, other methods like AddCSOIntoSelectionSet or PutSelectionSetIntoCSO are a bit less obvious, but at the first glance, we have enough to start with. However, there is no real-world example or use case which could help us at the beginning.
One of the most annoying CATIA features, especially when you work with large assemblies is reordering of specification tree in Products. Even as a programmer there is almost nothing you can do about it, because there is no direct way of reordering components in specification tree. Such a function has not been exposed to CATIA API yet. There are a few tools available on the internet and maybe you already use some of them. You may have even thought how the hell they work. So stop wondering, today I am going to show you how they (might) works :).