Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 02-01-2018, 12:10 AM
gmayor's Avatar
gmayor gmayor is offline Loop macro to adjust text formating within Word Windows 10 Loop macro to adjust text formating within Word Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,144
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

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
Reply With Quote
Reply



Similar Threads
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
Loop macro to adjust text formating within Word Loop through Word doc to find and reformat text Sandy27 Word VBA 5 01-06-2014 03:48 PM
Loop macro to adjust text formating within Word Macro to loop in Word Yamaha Rider Word VBA 2 02-07-2012 05:33 PM
Loop macro to adjust text formating within Word WORD Macro - import picture - resize - position - page break - loop 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

Other Forums: Access Forums

All times are GMT -7. The time now is 09:02 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft