1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

I need automatic consecutive numbering on each invoice(excel 2003)

Discussion in 'Business Applications' started by SquareOne, May 28, 2009.

Thread Status:
Not open for further replies.
Advertisement
  1. SquareOne

    SquareOne Thread Starter

    Joined:
    May 28, 2009
    Messages:
    2
    I have designed a simple printable invoice for my own work on Excel 2003 and want to generate consecutive "Invoice Number" numbers each time I print it.

    Is this possible ? :confused: Office Online has not come up with what I need. It's kind of urgent. Using Vista .


    Many thanks :) for suggestions.
     
  2. gaorr

    gaorr

    Joined:
    Oct 21, 2002
    Messages:
    47
    I found this on the net. Seems to work.

    Let's say the "invoice" cell is A1. You need to put this code in the workbook's _Open event and it will do what you need. To get access to that event, from Excel press Alt+F11 which will start the VBA editor. Once it opens, press CTRL+R to show the Project Explorer. Find and double click the line that says VBAProject(<yourfilename>.xls) where <yourfilename> is the saved name of your file. Then, find and double click 'ThisWorkbook'. In the window that appears on the right, paste in the code below. Press Alt+F11 to get back to Excel, then save and close the file. When it opens again, cell A1 will be one value higher than before.
     
  3. gaorr

    gaorr

    Joined:
    Oct 21, 2002
    Messages:
    47
    a bit easier

    Let's say it's cell E2 in sheet1 that you want to increment. Open this file, right-click the Excel LOGO near the file menu, select View Code, put this code in:
    Private Sub Workbook_Open()
    With Sheets("Sheet1").Range("E2")
    .Value = .Value + 1
    End With
    End Sub
     
  4. SquareOne

    SquareOne Thread Starter

    Joined:
    May 28, 2009
    Messages:
    2
    Hello....thank you so much for going to the trouble of looking on the internet for me. Your method hasn't worked for me unfortunately but I've copied it and it will be tried out again on Thursday. This problem has stumped quite a few. I shall be seeing my IT teacher on Thursday to see if she has a solution and for her to try out yours.
    I shall definitely let you know our results. Many thanks again :)
     
  5. slurpee55

    slurpee55

    Joined:
    Oct 20, 2004
    Messages:
    7,837
    Gaorr's method works perfectly, IF your invoice number is purely numerical. If it is a string (e.g. a100) you will get an error.
     
  6. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/830786