WUGNET, the Windows User Group Network
Your Complete Resource Center for "The Best" in Shareware, Computing Tips and Support, Windows Industry News... and much more!
Home Forums Shareware Windows Tips Hot Offers FREE Newsletters Arcade Contact Us About Partners
Search WUGNET: RSS Feeds RSS Feeds Advertise with WUGNET    |    Shareware eBooks
HomeHome FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Table : how to mix the data in column 1 ?

 
   Home -> Office -> Tables RSS
Next:  Tables: Widow/Orphan Protection  
Author Message
MoiMeme

External


Since: Jun 04, 2006
Posts: 7



(Msg. 1) Posted: Mon Sep 15, 2008 9:00 pm
Post subject: Table : how to mix the data in column 1 ?
Archived from groups: microsoft>public>word>tables (more info?)

Hi,

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

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

TIA !!!
Back to top
Login to vote
Doug Robbins - Word MVP

External


Since: Jul 14, 2006
Posts: 4340



(Msg. 2) Posted: Tue Sep 16, 2008 3:04 am
Post subject: Re: Table : how to mix the data in column 1 ? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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" <antispam.TakeThisOut@no.spam> wrote in message
news:etMH$U2FJHA.4784@TK2MSFTNGP05.phx.gbl...
> Hi,
>
> I have a table in Word 2002/XP
> I want to mix the data in column 1 ( alphabetic only with , and Wink
>
> Is there a way to achieve that ? I do not want to sort but to mix randomly
>
> TIA !!!
>
Back to top
Login to vote
Phil

External


Since: Apr 11, 2006
Posts: 120



(Msg. 3) Posted: Tue Sep 16, 2008 3:04 am
Post subject: Re: Table : how to mix the data in column 1 ? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Thanks a lot.
Works fine.
But my tables that i want to mix up do not contain a header row. So I want
row 1 mixed as well. Have tried to set j to 1 in the for j=2 to i+1, but that
doesn't work. Row 1 still sticks to row 1.
How should I proceed ?

Many thanks ! That was fast and well done.

"Doug Robbins - Word MVP" wrote:

> 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" <antispam.RemoveThis@no.spam> wrote in message
> news:etMH$U2FJHA.4784@TK2MSFTNGP05.phx.gbl...
> > Hi,
> >
> > I have a table in Word 2002/XP
> > I want to mix the data in column 1 ( alphabetic only with , and Wink
> >
> > Is there a way to achieve that ? I do not want to sort but to mix randomly
> >
> > TIA !!!
> >
>
>
>
Back to top
Login to vote
Phil

External


Since: Apr 11, 2006
Posts: 120



(Msg. 4) Posted: Tue Sep 16, 2008 3:04 am
Post subject: Re: Table : how to mix the data in column 1 ? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Hi,

have found out that I have to use Sort instead of SortAscending which
excludes row 1 from sort.
Now works as I wanted using simply aTable.Sort ( haven't used parameters
since get error when trying, and default behaviour works fine)

Thanks again for the hints !

"Phil" wrote:

> Thanks a lot.
> Works fine.
> But my tables that i want to mix up do not contain a header row. So I want
> row 1 mixed as well. Have tried to set j to 1 in the for j=2 to i+1, but that
> doesn't work. Row 1 still sticks to row 1.
> How should I proceed ?
>
> Many thanks ! That was fast and well done.
>
> "Doug Robbins - Word MVP" wrote:
>
> > 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" <antispam.DeleteThis@no.spam> wrote in message
> > news:etMH$U2FJHA.4784@TK2MSFTNGP05.phx.gbl...
> > > Hi,
> > >
> > > I have a table in Word 2002/XP
> > > I want to mix the data in column 1 ( alphabetic only with , and Wink
> > >
> > > Is there a way to achieve that ? I do not want to sort but to mix randomly
> > >
> > > TIA !!!
> > >
> >
> >
> >
Back to top
Login to vote
Display posts from previous:   
       Home -> Office -> Tables All times are: Eastern Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Categories:
 Windows XP
 Windows Vista
 Windows Other
  Office
 Office Other
 Security
  • Home |
  • Shareware |
  • Windows Tips |
  • Hot Offers |
  • FREE Newsletters |
  • Arcade |
  • Forums |
  • eBooks |
  • About WUGNET |
  • Partners |
  • Contact

  • WUGNET Privacy Policy |
  • Link to WUGNET |
  • IT Support