+ Reply to Thread
Results 1 to 3 of 3

Self saving Excel 2007 template with Invoice number generator

  1. #1
    Registered User
    Join Date
    01-29-2010
    Location
    Louisville
    MS-Off Ver
    Excel 2007
    Posts
    1

    Self saving Excel 2007 template with Invoice number generator

    I have created an Invoice template using excel 2007.

    The actual "Invoice Number" is stored in a cell (K 3)

    I am looking for a VBA procedure or function which runs when the spreadsheet opens.

    On opening the spreadsheet the following events could occur

    1. Cell K 3 (the invoice number) is incremented by one.

    2. The (template) spreadsheet is then saved (with the invoice number incremented so that next time the template is instantiated, the invoice number will be one higher)

    3. The spreadsheet then calls a (save as) function and saves itself in an "invoices" directory eg: "x:\invoices"
    with the filename Invoice12345.xls (where in this example, 12345 is the newly incremented invoice number)

    I know a little bit of VBA, but I am an Excel newbie and was hoping someone could help.
    Thanks in advance for anyones help with this!
    Last edited by Tomacat; 01-29-2010 at 11:08 AM.

  2. #2
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: Self saving Excel 2007 template with Invoice number generator

    Here is the basic code which, admittedly, is not very robust in terms of error checking, but I'm inclined at the moment to put more effort into it. Do some searching on checking to see if a folder/file exists, etc.

    In the workbook open event and used to increment K3.
    Please Login or Register  to view this content.


    Code to create the invoice workbook as new file and saved to a fixed location that exists.
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Palmetto

    Do you know . . . ?

    You can leave feedback and add to the reputation of all who contributed a helpful response to your solution by clicking the star icon located at the left in one of their post in this thread.

  3. #3
    Registered User
    Join Date
    05-21-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2007
    Posts
    1

    Re: Self saving Excel 2007 template with Invoice number generator

    can anyone explain below formula

+ 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