Ask Experts Questions for FREE Help !
Ask
    rick141's Avatar
    rick141 Posts: 1, Reputation: 1
    New Member
     
    #1

    Nov 5, 2011, 06:14 AM
    How do I create formula for sequential numbers in Excel?
    I need a macro so that every time I open the same excel file it increases my invoice number by 1 and saves the file. e.g. on opening file invoice number changes for alb00001 to alb00002 to alb00003 and so on
    JBeaucaire's Avatar
    JBeaucaire Posts: 5,426, Reputation: 997
    Software Expert
     
    #2

    Nov 7, 2011, 11:55 PM
    Format the cell in question with a custom number format of:

    "alb"000000

    Then put the number 1 in there to start, should appear as alb000001.

    Assuming that is Sheet1 cell A1, then this macro in the ThisWorkbook module will increment that number each time the workbook is opened.

    Code:
    Private Sub Workbook_Open()
       With Sheets("Sheet1").Range("A1")
          .Value = .Value + 1
       End With
    End Sub

Not your question? Ask your question View similar questions

 

Question Tools Search this Question
Search this Question:

Advanced Search

Add your answer here.


Check out some similar questions!

Sequential numbering in Excel [ 3 Answers ]

Hi, I'm trying to number a column in sequential order by counting the number of times a certain word is typed in another range. For example: AAA 1 BBB 1 AAA 2 AAA 3 CCC 1 I need the numbers to be in sequence in column B:B every time a word is typed multiple times in column A:A.

Sequential numbering in excel 2007? [ 3 Answers ]

Sequential Numbering in Excel Sheets. Sheet 1 - Copy to Sheet 2 But No in Cell "A1" must Change to next No i.e 0001 to 0002.

Auto Generating Sequential Numbers in Excel 2003 [ 2 Answers ]

Hello All I would like to have sequential Auto Generated Numbers in column A of my Excel 2003 Spreadsheets e.g A1=1, A2=2, A3=3 etc. But I would like Excel to auto generate this number, rather than input?


View more questions Search