+ Reply to Thread
Results 1 to 6 of 6

Generating incremental invoice number based on date

  1. #1
    Registered User
    Join Date
    10-02-2019
    Location
    Dhaka, Bangladesh
    MS-Off Ver
    2016
    Posts
    36

    Generating incremental invoice number based on date

    Hi,

    Currently I am using the below code to generate new invoice number like A2B-1001 where A2B-1000 is already put in cell F2. When i trigger this macro it clears certain cells and changes the value in F2 to A2B-1001.

    This is done with the following line in the attached code:
    Range("F2").Value = Left(Range("F2").Value, 4) & 1 + Mid(Range("F2").Value, 5, 4)

    Please Login or Register  to view this content.
    But I need the invoice number to be like YYMMDDNNN where NNN will change like 001, 002, 003 etc invoices made on same date.

    This forum is of great help & I hope that I will not be disappointed.

    Thanks in advance.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Generating incremental invoice number based on date

    Hello excellon,

    Is the invoice number affected by any other code or formulas in the workbook?
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    10-02-2019
    Location
    Dhaka, Bangladesh
    MS-Off Ver
    2016
    Posts
    36
    Quote Originally Posted by Leith Ross View Post
    Hello excellon,

    Is the invoice number affected by any other code or formulas in the workbook?
    Hi Leith,

    No, it's independent of any other code or formula.

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Generating incremental invoice number based on date

    Hello excellon,

    Do you want the invoice number to reset to 001 on the next day?

  5. #5
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Generating incremental invoice number based on date

    Hello excellon,

    The easiest way to do this to use two cells. In the macro I chose F2 and F3. Changes these what ever you want them to be.

    In cell F2 is the formula "=Today()" and if F3 is a 1, the starting serial for the day. The macro formats these as YYYYMMDDNNN in the email. After the email is sent, the serial number will either be increased by 1 or reset to 1, if the date has changed.

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    10-02-2019
    Location
    Dhaka, Bangladesh
    MS-Off Ver
    2016
    Posts
    36

    Re: Generating incremental invoice number based on date

    Quote Originally Posted by Leith Ross View Post
    Hello excellon,

    The easiest way to do this to use two cells. In the macro I chose F2 and F3. Changes these what ever you want them to be.

    In cell F2 is the formula "=Today()" and if F3 is a 1, the starting serial for the day. The macro formats these as YYYYMMDDNNN in the email. After the email is sent, the serial number will either be increased by 1 or reset to 1, if the date has changed.

    Please Login or Register  to view this content.
    Hi Leith,

    Sorry for my late response. Actually I did not receive the notification.

    I already had a today's date formula in cell F9 and F2 is the cell where I put the serial number 01. And I have made a slight change in your code & it works.

    Please Login or Register  to view this content.
    Thanks a lot for your time and effort.

+ 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. Invoice Information Based On Invoice Number
    By bj90 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-25-2019, 05:35 PM
  2. Replies: 4
    Last Post: 11-04-2012, 12:43 PM
  3. Re-generating incremental numbers
    By razaas in forum Excel General
    Replies: 4
    Last Post: 09-05-2011, 04:13 AM
  4. Replies: 5
    Last Post: 01-02-2011, 11:06 PM
  5. Invoice incremental numbering
    By Colin Green in forum Excel General
    Replies: 0
    Last Post: 08-25-2008, 02:49 PM
  6. Generating Invoice Number
    By viruzman in forum Excel General
    Replies: 3
    Last Post: 02-09-2008, 02:03 PM
  7. Invoice number generating...
    By ChrisMattock in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-12-2006, 08:09 AM

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