ListObject::Sort Property
Gets the sort column or columns, and the sort order for the ListObject collection.
Assembly: Microsoft.Office.Tools.Excel (in Microsoft.Office.Tools.Excel.dll)
Property Value
Type: Microsoft.Office.Interop.Excel::Sort^A Microsoft.Office.Interop.Excel.Sort that represents the sort column or columns, and the sort order for the ListObject collection.
The following code example adds a ListObject to the current worksheet. The example then populates the ListObject, which corresponds to an Excel table, with two rows of arbitrary data and specifies that the sort is to be performed in ascending order based on the column range A1:A3. Next, the example calls the Microsoft.Office.Interop.Excel.Sort.Apply method to sort the table.
This example is for a document-level customization.
Show: