Automatic numbering in column

S

Slow Learner

I want to have numbering appear automatically in a column. My numbering is
like 06-01 then 06-02, 06-03 etc. Can anyone assist in how I set this up.
TIA
 
S

Suzanne S. Barnhill

Please provide more detail about where the 06 comes from. The rest is
simple.
 
S

Slow Learner

Hi Suzanne
The 06 represents the current year. Next year the numbering will start at
07-0001 etc.
TFHIA
 
D

Doug Robbins - Word MVP

Use the following code in a macro to insert numbers such as that in the
cells in the first column of the table in which the selection is located:

Dim i As Long
With Selection.Tables(1)
For i = 1 To .Rows.Count
.Cell(i, 1).Range.Text = "06-" & Format(i, "00#")
Next i
End With

If you don't want a number in the first row, use

Dim i As Long
With Selection.Tables(1)
For i = 2 To .Rows.Count
.Cell(i, 1).Range.Text = "06-" & Format(i - 1, "00#")
Next i
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
 
S

Suzanne S. Barnhill

Assuming that you want the numbering to be 06-01, 06-02, ... 06-10, 06-11,
.... 06-99, 06-100, you create a numbered style (or apply numbering to the
existing style) as follows:

1. Format | Style [your style] | Modify | Format: Numbering.

2. Choose 01, 02, 03 as the "Number style" and type in 06- in front of the
number field in the "Number format" box. OK.

3. Apply the style to the column in question.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top