On claude.ai (recommended)
Customize > Plugins > Add > Add marketplace, enter this repository, turn on Sync automatically, then open the plugin and press Add.
danielep71/SKILL-VBA-PERFORMANCE
VBA-PERFORMANCE is a plugin for Claude with one skill, vba-performance. Give it exported VBA or a macro that is slow: it scans the code, ranks the findings by how often each line runs, proposes fixes that keep the results identical, and times the old and the new version in Excel.
The scanner is a plain Python script you can also run on its own. No add-in, no dependency.
Release 1.0.0 · Plugin for claude.ai and Claude Code · Costs timed on Excel 365, 64-bit
Advice about VBA speed is easy to find and hard to trust. The skill follows four steps and keeps only what pays off on your code.
The checker lists every line that matches a known cost, with its rule, severity and the fix behind it.
A finding in a loop that runs 100,000 times matters; the same finding in a macro that runs once does not. The skill keeps what is hot and says why it drops the rest.
Each rule has a recipe and the traps that would change the result. A fix that would change behavior is proposed, never applied.
The old and the new macro run in Excel, one after the other, and the medians say whether the change paid off.
Each cost was timed in Excel 365 (64-bit), median of five runs, with every variant checked to return the same result. A selection from the running record; ratios hold better than absolute times.
| Pattern | Rule | Cost | Against the fix |
|---|---|---|---|
Large array passed ByVal ... As Variant (10,000 x 20) | PERF025 | 3.4 ms per call | 26,000x ByRef |
Debug.Print on every loop pass | PERF020 | 0.45-1.8 ms per line | 10,700-24,000x |
ws.UsedRange.Rows.Count in a loop condition | PERF024 | 0.21 ms per pass | 7,200-10,600x |
DoEvents on every loop pass | PERF009 | 46 us per pass | 1,700x |
| A row deleted per loop pass (2,500 of 5,000 rows) | PERF005 | 0.86 ms per delete | 152x an array rebuild |
.Select then ActiveCell per cell, ScreenUpdating on | PERF001 | 1.6 ms per cell | 55x a direct write |
Cells(r, c).Value read and write per row | PERF002 | 31 us per row | 42-46x one block read and write |
The figures, the machines and the raw output are in docs/RECOMMENDATIONS.md; the benchmark modules in docs/benchmarks reproduce them. The project wiki explains each cost and the traps that change results while optimizing.
The claude.ai plugin already syncs to a signed-in local Claude Code, so two copies would show up as two skills. Pick one path.
Customize > Plugins > Add > Add marketplace, enter this repository, turn on Sync automatically, then open the plugin and press Add.
danielep71/SKILL-VBA-PERFORMANCE
Build the plugin ZIP, or take it from a release with its checksum and signature, then upload it under Plugins > Add > Upload plugin.
python tools\build_plugin.py
Without claude.ai, copy the skill folder into your user skills. The README has the PowerShell commands.
.claude\skills\vba-performance
Then ask: “This macro takes four minutes on 80,000 rows. Find out why and speed it up without changing the results.”
The checker needs only Python 3. Start with the README, then the wiki. Questions, defects and ideas go to the issue tracker; vulnerabilities go through the private route in the security policy.
The checker reads text, not a compiled project: it does not know types or data sizes, and it does not follow calls into helpers. Every finding is a lead to confirm, and the skill confirms it against how often the code runs. Silence a confirmed false positive with a trailing 'perf-ignore. Costs were timed on Windows desktop Excel 365, 64-bit; absolute times differ on other machines, so rely on the ratios.