View Full Version : Generate Numbers Based On Month, Year And four Digit Number

11-20-2007, 11:18 AM
I need to generate a number based on month,Year-Four digit number. The VB would need to look to sheet3 Column A and go to the last number used then add one to that number and place that in say Sheet1 "J5". The numbers would need to start over every Month at 0001

Bob Phillips
11-20-2007, 11:26 AM
Where does Month come into it, it doesn't seem to be within the source data.

11-20-2007, 11:31 AM
The month and year are just identifiers To help sort the data by Month and Year. Then my CFO can see all of the records created during that month. The numbers would be 1107-0001, 1107-0002. The script would need to look at Sheet 3 Column A the last entry and the last 4 digits, then add one. Placing the whole number in some cell on Sheet 3 1107-0003.

Bob Phillips
11-20-2007, 11:33 AM
I am still not getting it. If it starts at 1 every month, why are we looking at the last number on Sheet1 and adding one to that. Even for a new month, that may not be 1.

Layout some data and show an example.

11-20-2007, 11:42 AM
I have added a date field to track the date. Now just a code to go to sheet 3 Column A get the last number + 1 and put it in cell B3 on sheet 1. I can assign it to a button click to get the number.