Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 10-19-2015, 05:21 AM
Charles Kenyon Charles Kenyon is offline Increment numbering: But in the order they are inserted Windows 8 Increment numbering: But in the order they are inserted Office 2013
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,533
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

This cannot be done with a field, automatic numbering is sequential by design; vba would be required.

In Excel I accomplished this by a cell at the bottom of the column that has the ID numbers which says MAX of the column +1. I then use a macro to insert a new row above the current one and put the value found in the bookmark for the formula in the ID column for the new row.

Here is the vba code to assign the new number to column Q of the new row:
Code:
'   Insert new row above selection
'
    
    Dim lRow As Long
    lRow = Selection.Row
    Selection.EntireRow.Insert
'
'   Assign Case Number
'
    Dim lNext As Long
    
    lNext = Range("Next_Number").Value
    
    Cells(lRow, "Q").Value = lNext
The cell with the MAX formula has the label "Next_Number."

I prefer using Excel for data rather than Word and wouldn't know how to get the MAX function to work in Word. I'm sure that something could be done using vba.
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Increment numbering: But in the order they are inserted Loop - Row increment jrt Excel Programming 1 04-16-2015 01:46 PM
Increment Numbers Darbsp Word 3 03-10-2015 05:25 AM
Increment numbering: But in the order they are inserted List Style Numbering picks up out of order number from LATER list spthomas Word 12 12-16-2013 05:23 PM
Increment numbering: But in the order they are inserted Word Heading Bullet Numbering increment SASE1984 Word 1 02-10-2012 01:06 PM
Increment Numbers Help Jazz43 Word 2 07-30-2010 02:48 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:36 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft