Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Word: how to start table numbering at other than one? 1

Status
Not open for further replies.

ixodid

Technical User
Dec 5, 2008
30
US
I have a Word 2007 document that is a table with four columns. The first column is sequential numbering. I have over 2000 rows and it takes a while to load the whole document when I open it so I wanted to archive the first 2000 rows and start a new document but retain the numbering.

How do I start a new table with numbering starting at something other than "1" (one) - for instance "2001"?
 


Hi,

What method did you use to achieve "sequential numbering" of your table rows?

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
so I wanted to archive the first 2000 rows and start a new document but retain the numbering."

i habe no idea what that means.

OK, you have a Word document, with a table in it that has 2000 rows. A poor idea in the first place IMO, but there you go.

No doubt it does take a while to "load the whole document when I open it". But what does "archive" mean???

And when you state start a new document, of what possible connection would a new document have to the first one? I mean you could...grab the number of rows in the current document, make a nwe document, add a table (I assume) and insert a number in the first row = other table row count + 1.

Other than that, please clarify what you want to do.


unknown
 
What method did you use to achieve "sequential numbering" of your table rows?"

I don't know. I started this Word document several years ago and it just numbers each row automatically as I add data.

Regarding the statement: "so I wanted to archive the first 2000 rows and start a new document but retain the numbering."

Sorry if that was not clear. I want to save the document with the first 2000 rows as a separate file and no longer add to it. Then I want to start over with a new document that is a continuation of the first 2000 rows so it starts at row 2001 so I don't have to wait the time it takes to open a very large Word document. Think of it as two volumes of a book - volume one and volume two.

"A poor idea in the first place IMO, but there you go."

It may very well be a poor idea, but did you consider I likely know less about this type of thing than you do and it's the only way I know how? If you could explain why it's a poor idea and offer alternatives, I and anyone else on this forum that is of my apparently low level of Word experience would appreciate learning something we could benefit from.

"what possible connection would a new document have to the first one?"

It is a running list of people's names and as the example I gave above, it's like two volumes of a large book.

"you could...grab the number of rows in the current document, make a nwe document, add a table (I assume) and insert a number in the first row = other table row count + 1."

I did not understand that.

I appreciate the response from both of you and I hope this was clear
 
Hi ixodid,

Since the numbering is automatic, you probably generated the numbering setup, by clicking on the 'Numbering' icon. In Word 2007, this icon appears on the Ribbon's Home tab.

To start the numbering from a given value after deleting the archived rows, simply right-click on the new first row's paragraph and choose Numering > Set Numbering Value, type in the new starting number and press OK.


Cheers
[MS MVP - Word]
 
Was there any mention of deleting archived rows??????


unknown
 
Hi Gerry,

That was the understanding I got from:
I want to save the document with the first 2000 rows as a separate file and no longer add to it. Then I want to start over with a new document that is a continuation of the first 2000 rows so it starts at row 2001 so I don't have to wait the time it takes to open a very large Word document.


Cheers
[MS MVP - Word]
 
Strange, I read that but I did not get ANY impression of anything being deleted.

quote]""you could...grab the number of rows in the current document, make a nwe document, add a table (I assume) and insert a number in the first row = other table row count + 1."

I did not understand that.
[/quote]This is EXACTLY the same as what macropod suggested.

"simply right-click on the new first row's paragraph and choose Numering > Set Numbering Value, type in the new starting number and press OK"

In othe rwords, you have to GET a number. Now you are stating 2000, then fine, use 2000. The point being is that you need to use a number.

I simply suggested table row count + 1, because that it what it is.

2000 table row count.....

new table row count start is....2000 + 1 (2001)

I state table.row.count because unless you are always going to stop at 2000, essentially hard-coding it, then it may be handy to be able to automate starting a new document from a table with, say, 1352 rows - i.e. a new document starting row numbering at 1353.

Or ANY number of rows. Therefore: table.rows.count + 1

I am not sure what there is to not understand.

The only reason I state 2000 rows in a Word table is that that is a LOT of rows. Excel is designed for things with rows. Word...not so much.

So, how exactly IS the numbering being done?
Code:
Sub MakeNewDoc_CountContinues()
Dim ColCount As Long
Dim rowCounter As Long
If Selection.Information(wdWithInTable) = True Then
   ColCount = Selection.Tables(1).Columns.Count
   rowCounter = Selection.Tables(1).Rows.Count
Else
   MsgBox "Selection not in table."
   Exit Sub
End If
Documents.Add

ActiveDocument.Tables.Add Range:=Selection.Range, _
   numrows:=1, numcolumns:=ColCount

ActiveDocument.Tables(1).Range.Cells(1).Range.Style = "MyTableNumbering"
With ListGalleries(wdNumberGallery).ListTemplates(5).ListLevels(1)
   .NumberFormat = "%1."
   .StartAt = rowCounter + 1
   .LinkedStyle = "MyTableNumbering"
End With
ListGalleries(wdNumberGallery).ListTemplates(5).Name = ""
   Selection.Range.ListFormat.ApplyListTemplate ListTemplate:=ListGalleries( _
      wdNumberGallery).ListTemplates(5), ContinuePreviousList:=True, ApplyTo:= _
      wdListApplyToWholeList, DefaultListBehavior:=wdWord10ListBehavior
End Sub
The above assumes that a proper Style is being used - MyTableNumbering.

This gets the rows count of the current table (the one the Selection is in), creates a new document, creates a new table, applies the MyTableNumbering style, and restarts it at....table.count.row + 1.

Voila, a new document with a table continuing on the counter.


unknown
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top