Loading
Ozgrid Excel Help & Best Practices Forums

Excel Video Tutorials / Excel Dashboards Reports



Results 1 to 3 of 3

Thread: Save template as new file and increment invoice number in template

  1. #1
    Join Date
    2nd November 2010
    Posts
    1

    Save template as new file and increment invoice number in template

    Main Invoice1.xlsxHello,

    I am trying to build an invoice template with incrementing invoice numbers. I was able to find the proper code on the site to make that work, but I now running into new problems which i was unable to find the code for.

    I want to make changes to the template and then save it as a new file and have the template stay as it was when I first opened it, but for it to have a new invoice number when I reopen it for a new invoice. I am also having a problem with not having the code carry over to a new excel sheet after I have saved it.

    I hope I am making sense and I apologize for asking a question that might have already been answered as I was unable to locate it. Below is the code and the file is attached.


    VB:
    Private Sub Workbook_open() 
         'Change the sheet and cell reference to where the invoice number is located
        With Sheets("Invoice").Range("M3") 
            .Value = .Value + 1 
        End With 
    End Sub 
    Private Sub Workbook_close() 
        Clear 
    End Sub 
    
    
    Last edited by AAE; November 2nd, 2010 at 20:47. Reason: revise thread title, add code tags

    Excel Video Tutorials / Excel Dashboards Reports


  2. #2
    Join Date
    17th November 2005
    Location
    Kent
    Posts
    645

    Re: Excel VB Code Help

    Your thread title is not very search friendly.

    However a quick search of the site returned several results.

    Look here
    http://www.ozgrid.com/VBA/save-as-cell.htm

    Do a search for saveas name in cell will reyurn more.

    Excel Video Tutorials / Excel Dashboards Reports


  3. #3
    Join Date
    19th January 2007
    Location
    South Carolina, USA
    Posts
    9,206

    Re: Save template as new file and increment invoice number in template

    Hello arin04,

    Welcome to Ozgrid.

    Thread titles are key to obtaining good search results and the new thread page is clear about the requirement to write titles that properly describe your thread.
    While "Excel VB Code Help" may express your personal need, in no way does it begin describe your thread or objective and is, therefore, of no use to others searching the forum for a similar solution. In future threads, please craft titles that use only search friendly key words that accurately describe your thread.

    All VBA code posted to the forum must be wrapped in code tags, which you omitted. I've added the tags for you this time only. Be sure to use themin future posts.

    How to use code tags: [code] your code here [/code]
    AAE
    ----------------------------------------------------

    Forum Rules | Message to Cross Posters | How to use Tags

Thread Information

Users Browsing this Thread

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

Possible Answers

  1. Replies: 3
    Last Post: September 8th, 2010, 19:03

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
  •  
porno