#1
|
|||
|
|||
Sort text alphabetical
May someone give an example of vba code to sort all lines alphabetical? MS Word 2007. |
#2
|
||||
|
||||
'Lines' area vague concept n a Word document. If you mean paragraphs then
Code:
Selection.Sort _ ExcludeHeader:=False, _ FieldNumber:="Paragraphs", _ SortFieldType:=wdSortFieldAlphanumeric, _ SortOrder:=wdSortOrderAscending
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
#3
|
|||
|
|||
Thanks, but can you provide the whole code, which i can copy paste to ms word?
|
#4
|
||||
|
||||
Add
Code:
Sub Macroname() Code:
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
#5
|
|||
|
|||
Is it possible to sort paragraphs in random order?
|
#6
|
||||
|
||||
Not in Word without a macro.
If I was tasked with doing this I would paste the paragraphs into Excel, add a column beside with the formula =Rand(), sort on that column and then paste the result back into Word.
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Sorting does not produce an alphabetical list. | alanterrill | Word | 7 | 11-22-2022 12:31 PM |
WORD Text Sort Limitation | Over65 | Word | 6 | 01-24-2022 05:08 PM |
What is the Word sort order for text? | Jennifer Murphy | Word | 2 | 01-27-2017 07:18 PM |
Alphabetical Sort - result not alphabetical! | hanvyj | Excel | 3 | 10-14-2013 10:59 PM |
How to sort word text in alphabetic order . | crossing | Word | 8 | 01-20-2012 09:51 AM |