+ Reply to Thread
Results 1 to 4 of 4

Add Date to Macro for automatic increment on invoices

  1. #1
    Registered User
    Join Date
    09-24-2010
    Location
    Victoria, BC
    MS-Off Ver
    Excel 2007
    Posts
    68

    Add Date to Macro for automatic increment on invoices

    Good Morning. I have a macro I use on some of my billing which automatically increments to the next number for each bill, but I would like to reformat it to add the current date in yyyymmdd numeric format to the beginning. So the first bill for September 21st, 2012 would read 2012092101, and increment from there. Here is my current macro:
    Please Login or Register  to view this content.
    Any help would be greatly appreciated.
    Last edited by Unca Wook; 09-21-2012 at 03:11 PM. Reason: Marking thread solved

  2. #2
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Add Date to Macro for automatic increment on invoices

    Does this help?

    Change:

    Range("BA19").Value = Range("BA19").Value + 1

    To this:

    Range("BA19").Value = Format(DateAdd("yyyy", 0, Date), "yyyymmdd") & Range("BA19").Value + 1

  3. #3
    Registered User
    Join Date
    09-24-2010
    Location
    Victoria, BC
    MS-Off Ver
    Excel 2007
    Posts
    68

    Re: Add Date to Macro for automatic increment on invoices

    Thank you John. That was just the tweak the formula needed.
    If I helped, say thanks by clicking on the star.

  4. #4
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Add Date to Macro for automatic increment on invoices

    You're welcome. Glad too hear it works, and thanks for the feedback.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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