View Single Post
  #2   Report Post  
Posted to microsoft.public.word.tables
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default Table : how to mix the data in column 1 ?

Running a macro containing the following code will sort the table in which
the selection is located in random order (assumes that row 1 is a header row
and is not included in the sort

Dim i As Long, j As Long
Dim atable As Table
Dim acol As Column
Set atable = Selection.Tables(1)
Set acol = atable.Columns.Add(BeforeColumn:=atable.Columns(1) )
i = atable.Rows.Count - 1
For j = 2 To i + 1
acol.Cells(j).Range.Text = (i * Rnd) + 1
Next
atable.SortAscending
atable.Columns(1).Delete


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"MoiMeme" wrote in message
...
Hi,

I have a table in Word 2002/XP
I want to mix the data in column 1 ( alphabetic only with , and

Is there a way to achieve that ? I do not want to sort but to mix randomly

TIA !!!