Note that I have renamed the worksheet code name to ‘shDetails’. You can specify the address of the folder where you want the invoices to be saved. In my case, it was a folder on my Desktop. This line specifies the folder location.If you decide to modify the invoice template, you need to make sure you are picking the right details by modifying this part of the code. The first highlighted section is what takes the details from the Details sheet and populates the invoice template.If you have a different template or a different folder location, you need to modify the below-highlighted parts of the code: The above code is what copies the details of a transaction, fills the invoice placeholder template with those details, creates a new workbook, and save the new workbook as a PDF in the specified folder. IgnorePrintAreas:=False, OpenAfterPublish:=False Sh.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _įPath & "\" & Fname, Quality:=xlQualityStandard, IncludeDocProperties:=True, _ Range("D18") = shDetails.Range("E" & RowNum)įPath = "C:\Users\sumit\Desktop\Invoice PDFs"įname = Format(shInvoiceTemplate.Range("D10"), "mmmm yyyy") _ Range("D16") = shDetails.Range("G" & RowNum) ![]() Range("D15") = shDetails.Range("F" & RowNum) Range("B15") = shDetails.Range("D" & RowNum) Range("D12") = shDetails.Range("C" & RowNum) Range("D11") = shDetails.Range("B" & RowNum) Range("D10") = shDetails.Range("A" & RowNum) Let me first show you the code and explain how it works: Sub CreateInvoice(RowNum As Integer) If you need a different format, you’ll have to edit the template and then adjust the backend VBA code. I created this invoice template with a format that I needed for my GST filings. You can download the Invoice Generator Template by clicking on the button below: This helps in keeping track of the invoices in case you have too many. Note that the names of the invoices are based on the month and the invoice number.įor example, an invoice with the date 15-04-2019 and the invoice number as 1 would be saved with the name April 2019_1.pdf. In case there are any changes in the invoice details, you can double-click on the client name again, and a new invoice will be created (and this will overwrite the old one). ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |