© Roy Cox (2005 - 2020)

.

Basic Invoice with Excel - auto-numberingI

Many people need to use Excel to produce invoices for their business. There are probably hundreds of free templates to download for Excel. The basic requirements for an invoice are: a unique identification number your business name, address and contact information the business or individual’s name and address of the customer you’re invoicing a clear description of what you’re charging for the date the goods or service were provided (i.e. the supply date) the date of the invoice the amount(s) being charged Sales Tax amount if applicable the total amount owed. What most people struggle with is automating the unique number element and this question crops up frequently on the Excel Forums such as Ozgrid. This simple invoice contains Excel VBA code to generate an automatic number for each invoice produced, The button on the invoice sheet calls this code:

What The Code does.

The invoice number is stored in I7 of the sheet. The code use this number to create a name for a copy to be archived in the same folder as the master workbook. Next the code and button are removed from the copy workbook. The copy workbook is then closed. The invoice number in the original WorKBook is incremented by one.

Download the example workbook

A Basic Invoice template

Page Title

Making Excel work for you.
Basic Invoice Template
Sub Archive_Inv()     Dim InvNm As String     ''/// Copy Invoice to a new workbook     With ThisWorkbook.Sheets("Template")         ''///get name and path for new workbook         ''///use .xls for earlier versions of Excel         InvNm = ThisWorkbook.Path & "\Inv" & .Range("I7").Value & ".xlsx"         .Copy ''///save invoice as new workbook         ActiveSheet.Shapes("btnSave").Delete    ''///<- remove the save button         ''///ActiveWorkbook.SaveAs InvNm '<- use for earlier versions of Excel         ''///use following line for versions of Excel since Excel 2007 to save without the code         ActiveWorkbook.SaveAs InvNm, FileFormat:=51         ActiveWorkbook.Close         .Range("I7").Value = .Range("I7").Value + 1 ''///<- increment the Invoice number     End With End Sub  Code to increment the invoice number
If you find this article useful You can help maintain my site by donating. Simply click the image below
Buy me a coffeeBuy me a coffee

© Ut duis incididunt ex officia

Veniam proident laboris. Deserunt voluptate cillum, laboris culpa nostrud ad, sunt quis. Labore ex minim occaecat ut. Velit in consectetur irure deserunt sit, ea do ut ea in mollit veniam tempor occaecat incididunt, esse id irure.
.

Basic Invoice with Excel - auto-numberingI

Many people need to use Excel to produce invoices for their business. There are probably hundreds of free templates to download for Excel. The basic requirements for an invoice are: a unique identification number your business name, address and contact information the business or individual’s name and address of the customer you’re invoicing a clear description of what you’re charging for the date the goods or service were provided (i.e. the supply date) the date of the invoice the amount(s) being charged Sales Tax amount if applicable the total amount owed. What most people struggle with is automating the unique number element and this question crops up frequently on the Excel Forums such as Ozgrid. This simple invoice contains Excel VBA code to generate an automatic number for each invoice produced, The button on the invoice sheet calls this code:

What The Code does.

The invoice number is stored in I7 of the sheet. The code use this number to create a name for a copy to be archived in the same folder as the master workbook. Next the code and button are removed from the copy workbook. The copy workbook is then closed. The invoice number in the original WorKBook is incremented by one.

Download the example workbook

A Basic Invoice template

Page Title

Logotype