View Single Post
 
Old 05-19-2013, 03:07 PM
macropod's Avatar
macropod macropod is offline Windows 7 32bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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
For installation & usage instructions, see: http://www.gmayor.com/installing_macro.htm
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote