Consulting

Results 1 to 5 of 5

Thread: Generate Numbers Based On Month, Year And four Digit Number

  1. #1

    Generate Numbers Based On Month, Year And four Digit Number

    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

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Where does Month come into it, it doesn't seem to be within the source data.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    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.

  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    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.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  5. #5
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •