![]() |
|
#2
|
||||
|
||||
|
Hi Walt,
After copying the data to Word, you could use a macro: Code:
Sub Demo()
Application.ScreenUpdating = False
Dim Tbl As Table
With ActiveDocument.Range
With .Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = "^13([!\[])"
.Replacement.Text = "|\1"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchWildcards = True
.Execute Replace:=wdReplaceAll
End With
Set Tbl = .ConvertToTable(Separator:=wdSeparateByParagraphs, NumColumns:=1)
With Tbl
.Sort ExcludeHeader:=False, FieldNumber:="Column 1", CaseSensitive:=False, _
SortFieldType:=wdSortFieldAlphanumeric, SortOrder:=wdSortOrderAscending
.Rows.ConvertToText Separator:=wdSeparateByParagraphs
End With
With .Find
.Text = "|"
.Replacement.Text = "^p"
.Execute Replace:=wdReplaceAll
.Text = "([!^13])^13\["
.Replacement.Text = "\1^p^p["
.Execute Replace:=wdReplaceAll
End With
While .Characters.Last.Previous.Text = vbCr
.Characters.Last.Previous.Text = vbNullString
Wend
End With
Application.ScreenUpdating = True
End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Outlook 2007 Sorting roblem
|
tgulez | Outlook | 2 | 08-02-2011 12:04 AM |
| Word 2007 - Index question | history | Word | 0 | 09-02-2010 05:01 AM |
Product Key Question - Word 2007
|
bob369 | Office | 2 | 08-21-2010 09:50 PM |
Sorting question
|
markg2 | Excel | 4 | 01-25-2010 03:13 PM |
| indenting paragraphs in word 2007 | Brent | Word | 0 | 01-17-2010 10:01 AM |