View Single Post
  #2   Report Post  
Posted to microsoft.public.word.tables
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default Macro to Sort on Time

Assuming column 1, assuming the column has a header row, and assuming the
time is in a legitimate time format, the following will sort the times

With ActiveDocument.Tables(1).Columns(1)
.Sort ExcludeHeader:=True, _
SortFieldType:=wdSortFieldDate, _
SortOrder:=wdSortOrderAscending
End With

If there is no header row change the ExcludeHeader to False

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org




SoNew2This wrote:
I work with a custom report writer that pulls data from a database
onto a report. One area of the report contains two columns with
multiple rows. One column is a time entry. The time entry can be 'out
of order'.
Is there some sort of Macro that will select this table and sort the
contents on the first (time) column?