Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 01-19-2017, 01:37 PM
alventuraz alventuraz is offline I need help please!!!! Please Windows 10 I need help please!!!! Please Office 2016
Novice
I need help please!!!! Please
 
Join Date: Jan 2017
Posts: 1
alventuraz is on a distinguished road
Default I need help please!!!! Please

Hello forum! After probably 10 hours searching on google and youtube for help i found this forum.
I'm a teacher and i have a presentation in 2 days. I have this issue that i cant solve. Basically i'm trying to separate the school students 3 in 3. I have a list of 4000 students and i want to separate the students 3 in 3 so i can print like that.

The list is like this. Example:

a
s
f
f
h
d
s
f
d
f
t
f
s
f
g
d
f
g
f
etc.............

i want to separate automatically in WORD 2016 to 3 in 3. To look like this :

d
i
f



y
g
e

y
j
v

u
f
n

etc....


I know this is probably the most stupid question someone done here and i'm sorry for that. I'm not a tech expert. I'm 56 years old. Thank you for your help and have a nice day!
Reply With Quote
  #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,101
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 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
Reply

Thread Tools
Display Modes


Other Forums: Access Forums

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


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