J
John
Hi there,
I'm trying to write a quick procedure to sort the selected columns in a
table. I've come up with the code below that ideally will enable the user
to select, say, two colums in a five column table and sort each one in turn
(leave the other columns unaffected).....:
Dim col As Word.Column
For Each col In Selection.Columns
col.Sort ExcludeHeader:=False, _
SortFieldType:=wdSortFieldAlphanumeric, _
SortOrder:=wdSortOrderAscending
Next col
......but this seems to sort adjacent selected columns as well. I've seen
that the Sort method for a Selection has a SortColumn flag, but this seems
to be a less flexible approach.
Can anyone tell me the best way to modify the above?
Many thanks
John
I'm trying to write a quick procedure to sort the selected columns in a
table. I've come up with the code below that ideally will enable the user
to select, say, two colums in a five column table and sort each one in turn
(leave the other columns unaffected).....:
Dim col As Word.Column
For Each col In Selection.Columns
col.Sort ExcludeHeader:=False, _
SortFieldType:=wdSortFieldAlphanumeric, _
SortOrder:=wdSortOrderAscending
Next col
......but this seems to sort adjacent selected columns as well. I've seen
that the Sort method for a Selection has a SortColumn flag, but this seems
to be a less flexible approach.
Can anyone tell me the best way to modify the above?
Many thanks
John