Yes, there is an invoice template in Excel you can open in under ten seconds via File → New → Search Templates → "Invoice". That stock template, however, stops at a clean layout. The moment you need to pull client data from a ledger, auto-calculate federal and state tax, or batch-generate 30 invoices per month without re-entering line items, you move into VBA territory. Whether you sit at a home desk in a spare bedroom or run your bookkeeping practice out of a co-working space, the goal is the same: stop typing the same numbers every billing cycle.

Freelance bookkeeper at a home desk building an Excel invoice template with VBA code open
The moment your invoice template gets a VBA module attached, every recurring billing cycle drops from 45 minutes to about two.

Building Your First Custom Invoice Template from Scratch

Excel ships a generic invoice template under File → New → Templates for Today → Invoice, but many freelance bookkeepers tend to move past it within a week. The reason is simple: it has no data validation, no link to your client ledger, and no macro-ready structure. Start by creating a new workbook with three worksheets: Invoice, Client_Data, and Settings. On the Invoice sheet, label columns A through F as Invoice #, Date, Client Name, Line Item, Qty, and Unit Price. Column G uses the formula =E2*F2 for the extended amount. At the bottom, a SUM formula aggregates subtotals before tax.

On the Settings sheet, store your default tax rate (e.g., 0.07 for Texas) and your business header. Reference that cell in your invoice so one edit updates every future document. This keeps your template portable across clients without hard-coding values.

  • Validation: Use Data → Data Validation to restrict the Qty column to whole numbers between 1 and 999.
  • Protection: Lock all formula cells via Review → Protect Sheet so clients cannot accidentally break your calculations.
  • Printing: Set the page margins to 0.5 inches all around so a letter-size page prints cleanly from a standard home printer.
Close-up of an Excel workbook with three sheets labeled Invoice, Client_Data, and GL ledger
Three-sheet structure keeps your invoice, client data, and general ledger in one workbook without cross-sheet formula chaos.

Turning It Into a Tax-Ready Invoice for US Clients

A tax invoice in the US is not just a receipt; it is a document your client's accountant or the IRS may scrutinize during reconciliation. Your template must display your EIN (or SSN for sole proprietors), a sequential invoice number, the billing period, and a clearly separated sales-tax line. In the Settings sheet, add rows for your state (e.g., California), local tax authority, and exemption threshold. On the Invoice sheet, nest two IF formulas: one checks whether the client's state matches your Settings cell, and the other applies the correct combined rate (state + county, often 7.25% in Los Angeles County).

For clients who are tax-exempt nonprofits, add a checkbox column on Client_Data. Your formula then reads =IF(checkbox=TRUE,0,subtotal*tax_rate), zeroing out tax automatically. This single check can spare you from manual overrides when you bill a museum or school district.

  1. Label the tax line "Sales Tax (7.25%)" with the rate pulled from Settings so it updates if your state changes.
  2. Add a "Total Due" cell using SUM of subtotal plus tax.
  3. Include a 30-day net payment term line: "Net 30 — due [date + 30]."

Automating Your Ledger with a VBA Module

Once your invoice is finalized, the data still has to land in a ledger. Instead of copy-pasting rows into a separate workbook, open the Visual Basic Editor (Alt + F11) and insert a new module named modLedger. Write a subroutine called PushToLedger that reads the invoice number, date, client, and total from the active Invoice sheet, then appends that row to a GL worksheet in the same workbook. Use Worksheets("GL").Cells(Rows.Count, 1).End(xlUp).Row + 1 to find the next empty row.

Two critical rules for financial VBA: first, never use 'On Error GoTo ErrorHandler' with proper error logging—it silently swallows data-corruption bugs in ledger scripts. Instead, write On Error GoTo ErrorHandler and log the error number, description, and timestamp to a Log sheet. Second, running any macro clears Excel's Undo stack, so always save a backup copy of your workbook before executing. VBA does not run in Excel for the Web, so keep this workflow on your desktop or laptop.

  • Reconciliation trigger: Add a Worksheet_Change event that watches the GL sheet and flags any row where debit does not equal credit.
  • Monthly close: A single macro button runs PushToLedger, then RunReconciliation, then exports a PDF summary to your client folder.

Writing Your First VBA Payroll Script

Freelance bookkeepers often handle simple 1-to-5-employee payroll, and that is where a payroll script pays for itself in hours saved. Create a Payroll worksheet with columns for Employee, Gross Pay, FICA (7.65%), Federal Withholding, State Withholding, and Net Pay. In modPayroll, write a Sub CalculatePayroll() subroutine that loops through each data row, applies a Function for progressive federal brackets, and writes the net to the rightmost column.

Keep the script read-only against the input range. Lock the input cells with a password so a mistaken edit cannot corrupt a prior quarter's data. After the loop finishes, call a second subroutine DepositSummary that totals FICA and withholding into two cells on a Deposits sheet, ready for your quarterly 941 filing. This is not a replacement for a payroll service like Gusto; it is a lightweight reconciliation tool when your client pays five people and the volume is too small for SaaS overhead.

  1. Define the federal tax brackets as a 2-D array inside the function so updates are a single edit.
  2. After every run, generate a one-page PDF via ActiveWorkbook.ExportAsFixedFormat and save it to a date-stamped folder.
  3. Tag each run with a Now() timestamp in cell A1 of the Log sheet for audit trail.

Structuring Your Workbook for Freelance Scale

When you move from one client to fifteen, a single-file workbook collapses under the weight of interdependent ranges. Split your data: keep the template in a .xltx file, store all client records in a separate .xlsx data file, and let a master workbook link between them with HYPERLINK and Workbooks.Open calls. Store your macro code in an .xlsm "engine" file so clients never see your scripts.

This separation means your invoice template stays clean, your ledger stays auditable, and your payroll scripts stay isolated from client-facing sheets. You can hand the .xltx to a new client in under two minutes, populate the .xlsx from their last bank export, and let the .xlsm engine run the full reconciliation cycle on a scheduled macro.

Workflow StageManual (No VBA)VBA-AutomatedTime Saved per Month (Est.)
Invoice creation (30 clients)~45 min each~2 min each (macro batch)~20 hrs
Ledger entryCopy-paste, 10 min/invoiceAuto-push, 0 min~5 hrs
Tax calculationManual IF checkFormula + macro validation~2 hrs
Payroll (5 employees)~90 min per cycle~15 min (script run)~7 hrs
Disclaimer: This content is provided for general informational purposes only and does not constitute official financial, tax, or legal advice. Regulations vary by jurisdiction; consult a certified financial planner, accountant, or tax professional for your specific circumstances.

Frequently Asked Questions

Where exactly is the built-in Excel invoice template located?

Open Excel, go to File → New, type "Invoice" in the search box under Templates for Today, and hit Enter. You will see Microsoft's standard invoice layout. It is a starting point, not a full accounting workflow—many freelance bookkeepers rebuild it with client data sheets and VBA within the first week.

Can I run VBA macros in Excel on my phone or in a browser?

No. VBA macros execute only in the desktop versions of Excel (Windows and macOS). Excel for the Web and the mobile app do not support the Visual Basic Editor or any Sub / Function modules. If you need to view your invoice or ledger on the go, export to PDF first; run the scripts on your desktop machine.

How do I protect my VBA code so a client cannot accidentally delete it?

In the VBA Editor, select your module, open Tools → VBAProject Properties → Protection, and set a password. This hides the code but does not encrypt it—anyone can unprotect it if they know the password. For true isolation, keep your macro logic in an .xlsm engine file that is never shared with clients; they only receive the .xltx template and the .xlsx data file.