If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Random Sorting
Is there any way to randomly sort text in Word 2003?
|
#2
|
|||
|
|||
Found this in Google. Try:
Sub RandomWords() Dim myArray() As String, myTemp As String Dim Index As Long, OtherIndex As Long If Selection.Type = wdSelectionIP Then MsgBox "Please select some words" Exit Sub End If myArray = Split(Selection.Text) Randomize For Index = 0 To UBound(myArray) OtherIndex = Rnd * UBound(myArray) myTemp = myArray(Index) myArray(Index) = myArray(OtherIndex) myArray(OtherIndex) = myTemp Next Index Selection.Text = Join(myArray) End Sub -- Greg Maxey A peer in "peer to peer" support Rockledge, FL To e-mail, edit out the "w...spam" in KelliC wrote: Is there any way to randomly sort text in Word 2003? |
#3
|
|||
|
|||
Another method, that doesn't involve code and let's you experiment: copy the
text and paste into an Excel spreadsheet. Insert a column. Select an arbitrary substring from each item of text eg =Mid(A1,6,4) to take 4 characters starting with the sixth. Sort on that column. Copy and paste back into Word. "KelliC" wrote in message ... Is there any way to randomly sort text in Word 2003? |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Random Number Generator | Rich | Worksheet Functions | 4 | August 17th, 2004 07:19 PM |
Random Function in VB | Jim Campbell | New Users | 10 | August 8th, 2004 12:33 AM |
random number generator formula | Dave R. | Worksheet Functions | 1 | October 7th, 2003 04:02 AM |
Random Numbers | L. Howard Kittle | Worksheet Functions | 1 | September 18th, 2003 07:20 PM |