Here's one way:
Procedure to sort a two dimension array:
Dim MyArray() As Variant, i As Integer, j As Integer, m As Integer, n As
Integer, target As Document, newtable As Table, myitem As Range
'Load client data into MyArray
MyArray = ListBox1.List()
' Create a new document containing a table
Application.ScreenUpdating = False
Set target = Documents.Add
Set newtable = target.Tables.Add(Range:=target.Range(0, 0),
numrows:=ListBox1.ListCount, NumColumns:=2)
' Populate the cells of the table with the contents of the array
For i = 1 To ListBox1.ListCount
For j = 1 To 2
newtable.Cell(i, j).Range.InsertBefore MyArray(i - 1, j - 1)
Next j
Next i
' sort the table
newtable.Sort ExcludeHeader:=False, FieldNumber:="Column 2",
SortFieldType:=wdSortFieldDate, SortOrder:=wdSortOrderDescending
i = newtable.Rows.Count
' Get the number of columns in the table of client details
j = 2
' Set the number of columns in the Listbox to match
' the number of columns in the table of client details
ListBox1.ColumnCount = 2
' Define an array to be loaded with the client data
Dim NewArray() As Variant
'Load client data into MyArray
ReDim NewArray(i, j)
For n = 0 To j - 1
For m = 0 To i - 1
Set myitem = newtable.Cell(m + 1, n + 1).Range
myitem.End = myitem.End - 1
NewArray(m, n) = myitem.Text
Next m
Next n
' Load data into ListBox1
ListBox1.List() = NewArray
target.Close wdDoNotSaveChanges
Application.ScreenUpdating = True
--
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP