ARDHOLT Excel & VBA Casebook · all cases

Separate workbooks. Finished letters.

Splitting rows into files and copying account details into letters by hand invites mistakes.

1,200 rows → 6 separate workbooks · Check every group

Complete letter C001: Dear Account 001, Your statement amount is GBP 12.25. Please keep this letter with your records.

Read this letter · Download all 80 letters

Case 07 of 8 in Excel & VBA casebook

What was wrong

What I did

Proof

Separate files, with every row accounted for. The group list maps all 6 groups and 1,200 rows to their own workbooks. Download the six workbooks together, or open the first group’s workbook. Each contains only that group’s rows and the column headings. The summary workbook holds the file list and the other results.

All six groups, their separate workbook filenames and their row counts

One table with the headings lined up. 480 rows plus 360 rows become 840 rows, including 12 repeated rows kept intact. These are the opening rows; download the complete table.

Opening rows of the finished combined table

Every requested tab change explained. All 7 requests appear below: 2 names changed and 5 left unchanged. No existing tab was overwritten.

All seven requested tab changes, including the two accepted and five rejected requests

A finished letter for each account. The hero shows the first complete letter, with its own name and amount. Download all 80 letters, or read the last letter. The recipient list lets you check each one.

Workbooks: before · after · macro workbook. Details: letter template · result report · run log.

Developer details: reproduce the results and inspect the checks

Try it yourself

Optional technical check for a developer, from this folder with Docker installed:

./run.sh

It rebuilds the reference output and runs the checks. Setup, input format and macro instructions.

How it is tested

Tests

Run with Python/openpyxl for the reference outputs and business tests, and LibreOffice Calc 24.2.7.2 (headless) for the imported macros. Each macro’s result is checked against the source data and reference outputs.

The tests check row and value conservation, header alignment, duplicate preservation, rejected renames, exact letter contents and repeat runs. Test results · versions, timings and VBA checks.

Split checks open every generated .xlsx as an OOXML workbook and compare its headings, rows and values, including repeated rows. They also cover a new group, unsafe group labels, removed groups, empty input and repeat runs. Numbered filenames keep group labels out of file paths. The ZIP contents are checked against the individual files.

The command above runs the Python reference and its tests; the separate VBA runner executes the imported macros. The split macro uses LibreOffice’s native OOXML export in that run; its Excel branch uses Workbook.SaveAs. Macro-produced group workbooks: group 1 · 2 · 3 · 4 · 5 · 6 are retained separately from the Python downloads.

The retained before/after animations use workbook snapshots from those macro runs: split, merge, rename, letters. The full split, merge, rename and letter snapshots are available to inspect.

The publishing correction record documents the instruction-only edit to Instructions!C2 in the downloads and snapshots. Runtime measurements and recorded hashes remain historical; no macros were rerun for that edit.

Readable VBA: split · merge · rename · letters.


£39 for one agreed automation task, 5 working days. Splitting workbooks, merging tables, renaming tabs and preparing letters are separate tasks; £39 covers one agreed task.

Contact me through the platform where you found this case. I confirm the task and quote any additional work in writing before I start.