It is certainly possible to insert a table retrospectively. Much depends on
*exactly* how the document is formatted. From your description I assume that
the spacing is created with multiple spaces. You can therefore use that fact
to replace the superfluous spaces with tabs then convert the document to a
table. The following macro should do that. It uses three replacements (which
are the three parts of the first array replaced with the corresponding three
parts of the second array) to format a selected part of the document with
tabs rather than spaces.then converts that selection to a four column table.
Thus ([0-9]) @([0-9]) is replaced with \1^t\2 (which puts tabs between the
pounds, shillings and pence)
[space]{8,} is replaced with ^t (which replaces the long line of spaces
between the description and the amount - it assumes at least 8 spaces)
(£) @(s) @(d) is replaced by \1^t\2^t\3 (which puts the £sd header in the
same format as the amounts.)
The resulting selection is then converted to the table.You can then change
the column widths and text alignment to produce the results you require.
Dim vFindText As Variant
Dim vReplText As Variant
Dim sFormat As Boolean
Dim oRng As Range
Dim i As Long
sFormat = Options.AutoFormatAsYouTypeReplaceQuotes
vFindText = Array("([0-9]) @([0-9])", " {8,}", "(£) @(s) @(d)")
vReplText = Array("\1^t\2", "^t", "\1^t\2^t\3")
With Selection
Set oRng = .Range
With .Find
.Forward = True
.Wrap = wdFindContinue
.MatchWildcards = True
For i = LBound(vFindText) To UBound(vFindText)
.Text = vFindText(i)
.Replacement.Text = vReplText(i)
.Execute Replace:=wdReplaceAll
Next i
End With
End With
With oRng
.Select
WordBasic.TextToTable ConvertFrom:=1, NumColumns:=4, NumRows:=3
End With
http://www.gmayor.com/installing_macro.htm
If that doesn't work for you, send a sample of your document to the link on
the home page of my web site.
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>