Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.tables
|
|||
|
|||
Macro to Sort on Time
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? |
#2
Posted to microsoft.public.word.tables
|
|||
|
|||
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? |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I sort the time of day in a tabe? | Tables | |||
How do I sort the time of day in a tabe? | Tables | |||
Macro to run at time of print... | Microsoft Word Help | |||
Macro Run-time Error '5941' | New Users | |||
How do I create a macro to data sort in a table within a protecte. | Tables |