Can I automagically number lines in a table in Word 2003?

Can I automagically number lines in a table in Word 2003?

Post by jjsargen » Tue, 18 Dec 2007 08:33:55


I am working on a table showing the membership
list of an organization. I would like to have the
first column contain a line number, and to have
it automatically adjust as members are added
or deleted. Seems simple enough, and seems
as if it's something a lot of users might want to
do; but I haven't found anything in the online
help files that tells me how I can do that. I've
tried a few things (such as { =COUNT(a:a) },
properly inserted via Table | Formula) with
no success. If someone knows how to
accomplish this in Word 2003, please post
the trick for us.

Thanks in advance.

-- Jeffrey J. Sargent
 
 
 

Can I automagically number lines in a table in Word 2003?

Post by jjsargen » Tue, 18 Dec 2007 09:08:28

Addendum to my previous post: Only after
I made it did I notice that another group,
microsoft.public.word.tables, existed, and
that a similar question had recently been
asked and answered there. However, I would
still appreciate it if anyone could tell me if
there is a quick way to have a table column
automatically contain a line number, with no
period, right-justified, without having to tediously
click the "Align Right" button on the formatting
toolbar and enter Insert | Field | AUTONUMLGL
on every line. (This is especially of interest
since AUTONUMLGL is deprecated, provided
only for compatibility with previous versions,
but there seems no other way to prevent
insertion of a period after the number.
I wish to have a means of accomplishing
what I want that will be valid for years to
come, if Microsoft doesn't mess things up.)

-- Jeffrey J. Sargent

 
 
 

Can I automagically number lines in a table in Word 2003?

Post by JoAnn Paul » Tue, 18 Dec 2007 10:10:27

Automagically? I like that term!

--

JoAnn Paules
MVP Microsoft [Publisher]

~~~~~
How to ask a question
http://www.yqcomputer.com/
 
 
 

Can I automagically number lines in a table in Word 2003?

Post by Graham May » Tue, 18 Dec 2007 15:10:06

A SEQ field will not have a period?
With the cursor in cell A1, the following macro will number the cells in a
column and right align the result.

Sub NumberColumn()
With Selection
.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:= _
"SEQ TabCol1", PreserveFormatting:=False
.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend
.Copy
.SelectColumn
.Paste
.Fields.Update
.ParagraphFormat.Alignment = wdAlignParagraphRight
.MoveDown Unit:=wdLine, Count:=1
End With
End Sub
http://www.yqcomputer.com/

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://www.yqcomputer.com/
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>