A bank in Ghana · data and reporting · 2025 – nowIn use
Reporting automation in a bank
With only Excel, Outlook and Teams on the work PC, I turned copy-and-paste reporting into reusable tools: a daily branch campaign that runs itself, history trackers built from files that already exist, and rules the bank can reuse.
Internal work. No code, screenshots, customer data, branch names or figures are public.
A data clean-up needed every branch to fill in missing details for its own customers. By hand, that meant splitting one master list, saving a file for each branch and writing an email for each branch every day, then copying every reply back in. I turned it into one run in Excel VBA and Outlook.
Runs on the standard work PC. No new software, and no customer data leaves the bank.
- 08:01:02▸ prepare today's batch
- 08:01:03each branch: everything still outstanding, plus a few new records
- 08:01:05one file per branch · drop-down list for the missing field
- 08:01:09send log updated
- 08:01:11one email draft per branch
- 16:58:40▸ collect the replies
- 16:58:43reply files read · records matched by ID · columns found by heading
- 16:58:44“Sth & Sons” → SMITH AND SONS (alias fixed once, applied everywhere)
- 16:58:45IDs kept as text: leading zeros preserved
- 16:58:46saved automatically
- Master list
- Prepare today's batch
- One file and one email draft per branch
- Branches reply
- Collect the replies: match by ID, columns by heading, aliases
- Master list, auto-saved
The constraint
No new software. Each branch must only ever see its own records. Everything has to run on the work PC, and the people using it are busy.
The morning run
A data clean-up needed each branch to complete a missing field for its own customers, a few records at a time, with replies by close of day.
- Prepare today's batch picks each branch's records (everything still outstanding plus a few new ones, largest first). It writes a dated file per branch with a drop-down for the missing field, records what was sent, and creates one Outlook email per branch.
- Collect the replies pulls the reply attachments from several Outlook folders and reads each file back. It matches records by ID and finds columns by their heading, so a changed layout doesn't break it.
- Matching forgives capitals, spacing, plurals, “&” for “and”, one or two typing slips and truncated names. One alias sheet fixes a wording everywhere.
- There are repair routines, a resend path for when Outlook misbehaves, an automatic save after every run, and a reconciliation check against the totals.
- A line-by-line maintenance guide means someone else can run and fix the tool without me.
What it changed
Replies that used to be retyped are now read straight from the returned files. Running it also surfaced data-quality problems that had gone unnoticed, such as IDs that had lost their leading zeros.
The other tools
- Daily history rebuild: Rebuilds day-by-day history from saved daily reports that already exist, so no figure is retyped. VBA reads each saved daily file, takes the report date from inside it, finds columns by heading, logs any day two files disagree on, and reconciles the history against each day's totals.
- Name-classification rules: Classifies names in customer records so a recurring reporting question no longer needs a manual check each time. A Python rules engine with a name table. Matching tolerates titles, joined names, truncated names and spelling slips; a misspelling is accepted only when no competing name is as close.
- Follow-up tracker: Collects answers from many teams without anyone retyping them. A locked file per team where only the answer cells can be edited, pulled back into one master with Power Query from a folder. Tested end to end with simulated answers before rollout.
- Large-file consolidation: Brings large monthly files that are too big for one sheet into a single model. Power Query and the Data Model, keeping ID columns as text, with personal columns stripped and month-on-month measures in DAX, all on the work PC.
What broke in production, and what I learned
- OneDrive paths that VBA can't read.
- Drafts that only appeared in classic Outlook.
- A column-layout change in the middle of the campaign.
- A variable that shadowed VBA's own CDate function.
- A day of tracking that was never saved and had to be rebuilt from the saved files.
- The lesson: build for recovery, log everything, and save automatically.