No macro's! Just sort your input on InvoiceNo and insert subtotals on everychange of InvoiceNo. You can find the function under Data/Subtotals