+ Reply to Thread
Results 1 to 10 of 10

Serial Number to be reset with each day

  1. #1
    Registered User
    Join Date
    09-26-2016
    Location
    Dubai
    MS-Off Ver
    Excel 2013
    Posts
    24

    Serial Number to be reset with each day

    Hi everyone.
    What I need to do is that I need to generate a number which contains date,month,and then a serial number which needs to be reset with each new date.
    For eg 280901 (28-date 09-month 01- serial number), 280902, 280903...
    and then 290901 for the next date
    I am new to VB.
    Please help

  2. #2
    Valued Forum Contributor mangesh.mehendale's Avatar
    Join Date
    06-04-2015
    Location
    India
    MS-Off Ver
    2007
    Posts
    510

    Re: Serial Number to be reset with each day

    Is it okay if it is done with excel function... but caution is you have to remove the formulae on same day... refer attached file


    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Don`t care, take care...

    Regards,
    Mangesh

  3. #3
    Registered User
    Join Date
    09-26-2016
    Location
    Dubai
    MS-Off Ver
    Excel 2013
    Posts
    24

    Re: Serial Number to be reset with each day

    Hi Mangesh. Thanks for the code but I need it in VB macro and not an excel formula

  4. #4
    Valued Forum Contributor mangesh.mehendale's Avatar
    Join Date
    06-04-2015
    Location
    India
    MS-Off Ver
    2007
    Posts
    510

    Re: Serial Number to be reset with each day

    Okay... just hit on Generate button.... in attached file....

    Please Login or Register  to view this content.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    09-26-2016
    Location
    Dubai
    MS-Off Ver
    Excel 2013
    Posts
    24

    Re: Serial Number to be reset with each day

    Thank you so much!

  6. #6
    Valued Forum Contributor mangesh.mehendale's Avatar
    Join Date
    06-04-2015
    Location
    India
    MS-Off Ver
    2007
    Posts
    510

    Re: Serial Number to be reset with each day

    Welcome... Just give a time to Click no "Add Reputation" to answer.....

  7. #7
    Registered User
    Join Date
    07-13-2022
    Location
    London
    MS-Off Ver
    2206
    Posts
    3

    Re: Serial Number to be reset with each day

    This post is from 2016 but it was helpful today in the year 2022. Thank you for the code. I tried it and understood how each line works. However, it seems like there was no code to reset the serial key to 01 for each new month. Can you check it please if you are still active in this forum, thank you.

  8. #8
    Valued Forum Contributor mangesh.mehendale's Avatar
    Join Date
    06-04-2015
    Location
    India
    MS-Off Ver
    2007
    Posts
    510

    Re: Serial Number to be reset with each day

    Hi Jake.. Can you please provide example for better clarity..?

  9. #9
    Registered User
    Join Date
    07-13-2022
    Location
    London
    MS-Off Ver
    2206
    Posts
    3

    Re: Serial Number to be reset with each day

    Quote Originally Posted by mangesh.mehendale View Post
    Hi Jake.. Can you please provide example for better clarity..?
    Hi, thank you so much for your reply.

    I'll take the same example as the original thread creator but with better clarity. For example, 280901 (28-date 09-month 01- serial number), 280902, 280903 and it goes on. I would like only the serial number to be increased by 1. In the code you shared, it calculates it as 280901 + 1. When it reaches 280999, adding + 1 would be 281000. However, we want to continue it as 2809100 for that day. The next day would be the 29th, so the serial key should reset back to 01 which will be like 290901.

    I hope the above example is clear. I'm also trying to achieve something similar to it but instead of DDMM, I'm doing it with the YYYY. For example, 2022001 (2022-year and 001-serial number), 2022002, 2022003.... 20221000, and so on. The next starting year will be like 2023001 where the serial number willl reset back to 001.

  10. #10
    Registered User
    Join Date
    07-13-2022
    Location
    London
    MS-Off Ver
    2206
    Posts
    3

    Re: Serial Number to be reset with each day

    Hi, never mind I managed to somehow do it with the logic suggested in another post.

    Link: bytes.com/topic/access/answers/584213-reset-file-number-zero-each-year

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] count number in serial and break up serial count
    By gondal in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-28-2016, 08:44 AM
  2. [SOLVED] Generate serial number in group of x number
    By Ljung in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-26-2016, 09:46 AM
  3. [SOLVED] Auto Populate Serial Number From Total number
    By sanju2323 in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 08-04-2015, 04:33 PM
  4. code to generate serial number based on number of records
    By winmaxservices1 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-05-2015, 03:21 AM
  5. Overwrite the advanced filtered data serial number column with unique number
    By krjoshi in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-15-2012, 12:38 AM
  6. modify serial number if number already exists
    By surfengine in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-05-2010, 07:49 PM
  7. Finding a serial number in a list of serial numbers
    By zocoloco in forum Excel General
    Replies: 2
    Last Post: 02-04-2009, 05:20 AM

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1