Automatic Generation of record numbers


Board Regular
Sep 4, 2012
I am trying to create a spreadsheet of records that will automatically numerate cases.

There will be up to 1,000 records created annually.

Our existing process is a =MAX +1 formula, which requires numbers to be entered manually for each case (and is subject to human error)

Normally this would be an easy thing to do with a simple formula. However, there is a catch.

As the data is entered over time, the spreadsheet may be sorted by any number/combination of 85 columns.

If I was the only user, I could create an easy work around by converting previous case numbers to values only.

However, there will be multiple users of the spreadsheet, and most have very limited PC and excel skills.

Accidentally reassigning a case number to the wrong entry is an unacceptable risk.

Any thoughts?


New Member
Oct 31, 2016
Could you have a text box named "Add New Record" with a Macro assigned to it that would go to the next blank row, type in your formula of =MAX+1, then copy and paste the result back over the formula "As Value"?

All your numbers would be values, and less susceptible to inadvertent changes.


Well-known Member
Feb 7, 2012
Office Version
If the document numbers do not have to be absolutely consecutive, but remain sequential, then you could use something similar to the military logistics document numbering method.
Range("A1") = Format(Now, "YYMMDDHhnnss")
give you a number that looks like this: 161125171915, and won't be duplicated for the next hundred years. You could set it up with a worksheet selection change event macro that would assign the number when a user clicks in the document number box. The military uses a Julian date plus four digit serial number which they restart daily because it only gives them 9999 unique daily numbers.

Last edited:

Forum statistics

Latest member

Some videos you may like

This Week's Hot Topics

  • VBA (Userform)
    Hi All, I just would like to know why my code isn't working. Here is my VBA code: [CODE=vba]Private Sub OKButton_Click() Dim i As Integer...
  • List box that changes fill color
    Hello, I have gone through so many pages trying to figure this out. I have a 2020 calendar that depending on the day needs to have a certain...
  • Remove duplicates and retain one. Cross-linked cases
    Hi all I ran out of google keywords to use and still couldn't find a reference how to achieve the results of a single count. It would be great if...
  • VBA Copy and Paste With Duplicates
    Hello All, I'm in need of some input. My VBA skills are sub-par at best. I've assembled this code from basic research and it works but is...
  • Macro
    is it possible for a macro to run if the active cell value is different to the value above it
  • IF DATE and TIME
    I currently use this to check if date has passed but i also need to set a time on it too. Is it possible? [CODE=vba]=IF(B:B>TODAY(),"Not...