![]() |
|
#1
|
||||
|
||||
![]()
The following should do the trick, based on your examples
Code:
Sub Macro1() Dim i As Long Dim oRng As Range Dim vPara As Variant For i = 3 To ActiveDocument.Paragraphs.Count Set oRng = ActiveDocument.Paragraphs(i).Range oRng.End = oRng.End - 1 vPara = Split(oRng.Text, vbTab) If UBound(vPara) = 4 Then oRng.Text = vPara(0) & " " & _ vPara(1) & vPara(2) & " " & _ vPara(3) & " " & vPara(4) End If DoEvents Next i lbl_Exit: Set oRng = Nothing Exit Sub End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
VB for Word - Need macro to loop each line in a document | NDeane | Word VBA | 5 | 12-22-2015 08:12 PM |
![]() |
Sandy27 | Word VBA | 5 | 01-06-2014 03:48 PM |
![]() |
Yamaha Rider | Word VBA | 2 | 02-07-2012 05:33 PM |
![]() |
Nano07 | Word VBA | 2 | 11-02-2011 05:14 AM |
Macro for chart formating | QWERTY_Warrior | Excel Programming | 0 | 06-29-2011 07:38 AM |