Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.tables
jessim jessim is offline
external usenet poster
 
Posts: 3
Default Reverse table order/number rows

How can I:

a) Reverse the order of a table

and

b) Automatically number each row?

Thanks,
Jess
  #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 Reverse table order/number rows

Use a macro containing the following code

Dim i As Long
With Selection.Tables(1)
.Columns.Add beforecolumn:=.Columns(1)
For i = 2 To .Rows.Count
.Cell(i, 1).Range.Text = i - 1
Next i
.SortDescending
End With


--
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

"jessim" wrote in message
...
How can I:

a) Reverse the order of a table

and

b) Automatically number each row?

Thanks,
Jess



  #3   Report Post  
Posted to microsoft.public.word.tables
jessim jessim is offline
external usenet poster
 
Posts: 3
Default Reverse table order/number rows

Hi Doug,

The macro works great! Just one little problem: after it ran, the
rows are now numbered descendingly 84-1 instead of 1-84 (84 rows in my
table, natch). Is there a way to just reverse that 1 numbering column
alone?

Thanks again,
Jess

On Nov 29, 2:39 pm, "Doug Robbins - Word MVP"
wrote:
Use a macro containing the following code

Dim i As Long
With Selection.Tables(1)
.Columns.Add beforecolumn:=.Columns(1)
For i = 2 To .Rows.Count
.Cell(i, 1).Range.Text = i - 1
Next i
.SortDescending
End With

--
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

"jessim" wrote in message

...

How can I:


a) Reverse the order of a table


and


b) Automatically number each row?


Thanks,
Jess


  #4   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 Reverse table order/number rows

Use

Dim i As Long
With Selection.Tables(1)
.Columns.Add beforecolumn:=.Columns(1)
For i = 2 To .Rows.Count
.Cell(i, 1).Range.Text = .Rows.Count - i + 1
Next i
.SortAscending
End With

--
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

"jessim" wrote in message
...
Hi Doug,

The macro works great! Just one little problem: after it ran, the
rows are now numbered descendingly 84-1 instead of 1-84 (84 rows in my
table, natch). Is there a way to just reverse that 1 numbering column
alone?

Thanks again,
Jess

On Nov 29, 2:39 pm, "Doug Robbins - Word MVP"
wrote:
Use a macro containing the following code

Dim i As Long
With Selection.Tables(1)
.Columns.Add beforecolumn:=.Columns(1)
For i = 2 To .Rows.Count
.Cell(i, 1).Range.Text = i - 1
Next i
.SortDescending
End With

--
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

"jessim" wrote in message

...

How can I:


a) Reverse the order of a table


and


b) Automatically number each row?


Thanks,
Jess




  #5   Report Post  
Posted to microsoft.public.word.tables
jessim jessim is offline
external usenet poster
 
Posts: 3
Default Reverse table order/number rows

I think it's more due to my unfamiliarity with how macros work that I
just ended up accidentally deleting/fudging around with them. After
they ran, my tables ended up looking funny, so I did a workaround by
copy-and-pasting the first column to another document and reversing it
there, then pasting it back. Otherwise, the macros worked great and
did their job :-)

Thanks a lot,
Jess
Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Arbitrary number of rows in a table Kev[_2_] Mailmerge 1 November 6th 07 07:33 PM
how can I count the number of rows in an existing table roberto-cruz Tables 2 September 30th 07 10:41 AM
Count number of rows in table PamKT Microsoft Word Help 6 August 30th 06 09:32 AM
How can I reverse the order of page number and index entry? Sheila Page Layout 2 January 24th 06 03:37 PM
Limiting number of table rows per page Aniseed Tables 3 November 7th 05 11:34 AM


All times are GMT +1. The time now is 09:08 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"