
- MS Excel Basics
- Excel - Home
- Excel - Getting Started
- Excel - Explore Window
- Excel - Backstage
- Excel - Entering Values
- Excel - Move Around
- Excel - Save Workbook
- Excel - Create Worksheet
- Excel - Copy Worksheet
- Excel - Hiding Worksheet
- Excel - Delete Worksheet
- Excel - Close Workbook
- Excel - Open Workbook
- Excel - Context Help
- Editing Worksheet
- Excel - Insert Data
- Excel - Select Data
- Excel - Delete Data
- Excel - Move Data
- Excel - Rows & Columns
- Excel - Copy & Paste
- Excel - Find & Replace
- Excel - Spell Check
- Excel - Zoom In-Out
- Excel - Special Symbols
- Excel - Insert Comments
- Excel - Add Text Box
- Excel - Undo Changes
- Formatting Cells
- Excel - Setting Cell Type
- Excel - Setting Fonts
- Excel - Text Decoration
- Excel - Rotate Cells
- Excel - Setting Colors
- Excel - Text Alignments
- Excel - Merge & Wrap
- Excel - Borders and Shades
- Excel - Apply Formatting
- Formatting Worksheets
- Excel - Sheet Options
- Excel - Adjust Margins
- Excel - Page Orientation
- Excel - Header and Footer
- Excel - Insert Page Breaks
- Excel - Set Background
- Excel - Freeze Panes
- Excel - Conditional Format
- Working with Formula
- Excel - Creating Formulas
- Excel - Copying Formulas
- Excel - Formula Reference
- Excel - Using Functions
- Excel - Builtin Functions
- Advanced Operations
- Excel - Data Filtering
- Excel - Data Sorting
- Excel - Using Ranges
- Excel - Data Validation
- Excel - Using Styles
- Excel - Using Themes
- Excel - Using Templates
- Excel - Using Macros
- Excel - Adding Graphics
- Excel - Cross Referencing
- Excel - Printing Worksheets
- Excel - Email Workbooks
- Excel- Translate Worksheet
- Excel - Workbook Security
- Excel - Data Tables
- Excel - Pivot Tables
- Excel - Simple Charts
- Excel - Pivot Charts
- Excel - Keyboard Shortcuts
- MS Excel Resources
- Excel - Quick Guide
- Excel - Useful Resources
- Excel - Discussion
How to Automatically Generate the Invoice Numbers in Excel?
An invoice number is a number that is used as a unique identifier for any business in order to keep track of their records. The main requirement for invoice numbers is that they are distinct from one another and that they are in sequential order. If we try to use the numbers with the auto-fill handle, there is a chance that the numbers could have been duplicated or missed, but we can apply the special process to reduce those errors. This tutorial will help you understand how we can automatically generate invoice numbers in Excel.
Automatically Generate Invoice Number in Excel
Here we will apply the VBA code for the whole workbook. Let us see an uncomplicated process to see how we can automatically generate invoice numbers in Excel. We need to use the help of a VBA application, as it can’t be completed directly in Excel.
Step 1
Let us consider a new Excel workbook and then type the first invoice number. In our case, type 15600 in cell E2. The invoice number will start at 15600.
Then, right-click on the sheet name and choose View Code to open the VB application, then double-click on this workbook, and finally, enter the programme into the text box as shown in the image below. The code will apply to the whole workbook.
Example
Private Sub Workbook_Open() ‘Updated By Nirmal Range("E2").Value = Range("E2").Value + 1 End Sub
In the program, cell E2 is the one where we have entered our number.

Step 2
Save the sheet as a macro-enabled template and close the workbook. Now, whenever we close and open the workbook, the number in cell E2 will be increased by one, as shown in the image below. The code won’t work if we save the workbook as a regular sheet.

Conclusion
In this tutorial, we used a simple example to demonstrate how we can automatically generate invoice numbers in Excel.
- Related Articles
- How to Generate Lottery Numbers in Excel?
- How to Generate Random Decimal/Integer Numbers in Excel?
- How to get subtotals based on invoice number in Excel?
- How to Generate Random Positive and Negative Numbers in Excel?
- How to generate random positive numbers without duplicates in Excel?
- How to Automatically Insert an Equal Sign in Cells with Numbers in Excel?
- How to Automatically Insert Rows in Excel?
- How to Automatically Expand the Formula Bar in Excel?
- How to Automatically Fill Increment Cells in Excel?
- How to Automatically Colour the Alternating Rows/Columns in Excel?
- How to add borders automatically to cells in Excel?
- Excel random data: generate random numbers, texts, dates, times in Excel
- How to Automatically Generate Random Secure Passwords in Google Chrome?
- How to Automatically Resize the Textbox to Fit the Contents in Excel?
- How to Automatically Refresh a Pivot Table in Excel?
