Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 01-19-2017, 09:48 PM
gmayor's Avatar
gmayor gmayor is offline I need help please!!!! Please Windows 10 I need help please!!!! Please Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,137
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

Assuming that the letters represent names, and that each is in a separate paragraph, and that the second list (which bears no relationship to the first) is merely an example of what you wish to achieve then the following macro should work

Code:
Sub SplitList()
Dim oPara As Paragraph
Dim i As Long
Dim j As Long
    For Each oPara In ActiveDocument.Paragraphs
        If Len(oPara.Range) = 1 Then oPara.Range.Delete
    Next oPara
    j = ActiveDocument.Paragraphs.Count Mod 3
    For i = ActiveDocument.Paragraphs.Count - j To 1 Step -3
        ActiveDocument.Paragraphs(i).Range.InsertParagraphAfter
    Next i
End Sub
http://www.gmayor.com/installing_macro.htm
__________________
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
 



Other Forums: Access Forums

All times are GMT -7. The time now is 04:00 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