![]() |
#4
|
|||
|
|||
![]()
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 |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
jbengal | Word | 5 | 11-23-2022 02:17 PM |
![]() |
groovy chick | Word | 3 | 01-18-2012 04:49 AM |
How can create a form in Word 2007 that can be automatically filled? | artistech | Word | 0 | 08-04-2010 01:05 PM |
how to create a word document to be printed on a letterpad | damad | Word | 0 | 07-23-2009 12:11 AM |
How to add Table of Content in word document by C# ! ! ! | arun singh | Word | 0 | 11-12-2008 11:21 PM |