View Single Post
 
Old 07-31-2011, 09:26 AM
gmaxey gmaxey is offline Windows XP Office 2010 (Version 14.0)
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,598
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

Select all of the text include the last paragraph mark and run this macro:
Code:
Sub ScratchMacro()
'A quick macro scratch pad created by Greg Maxey
Dim i As Long, j As Long
Dim arrData() As String
Dim oRng As Word.Range
Dim oTbl As Word.Table
Set oRng = Selection.Range
ReDim arrData(oRng.Paragraphs.Count - 1)
For i = 0 To UBound(arrData)
  arrData(i) = Left(oRng.Paragraphs(i + 1).Range.Text, Len(oRng.Paragraphs(i + 1).Range.Text) - 1)
Next i
oRng.Delete
Set oTbl = ActiveDocument.Tables.Add(oRng, UBound(arrData) + 1, 2)
For i = 0 To UBound(arrData)
  oTbl.Cell(i + 1, 1).Range.Text = arrData(i)
Next i
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote