You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ready-to-use VBA code snippets to accelerate Excel development.
This repository provides a curated collection of code snippets designed for use with the Macro Tools VBA add-in. Snippets sync automatically from this repository, giving you instant access to reliable, production-tested code templates.
📖 Purpose
The snippets library extends Macro Tools VBA with:
✅ Pre-built templates for common VBA tasks
✅ Automatic updates via repository sync
✅ Logical categorization by functionality
✅ IntelliSense-friendly naming and auto-completion support
🛠️ Setup & Import Workflow
To manage snippets in your environment:
Open the Macro Tools VBA toolbar
Navigate to Other tools
Choose one of the following actions:
Action
Description
📂 Export Snippets to Folder
Exports all add-in snippets to a local ADDIN_MACRO_TOOLS_SNIPPETS folder, preserving category structure
📄 Add local JSON from Folder
Compiles exported snippet folders into a single JSON configuration file
📄 Import Snippets from local JSON
Imports snippets from a locally generated JSON file
🌐 Import Snippets from GitHub
Fetches the latest snippet library directly from this repository (warning: overwrites existing snippets)
💻 Using Snippets in Your Code
Open the VBA Editor (ALT + F11) and navigate to your target module
Start typing a snippet keyword (e.g., pusub, arr, LastRow)
Select Insert Code from the context menu
✅ The code inserts automatically; dependent modules or forms load as needed
💡 Pro Tip: Forgot a snippet name? Use the Insert Module tool in the VBE toolbar to generate a helper module named SNIPPETS. It contains a full catalog of available templates with descriptions and enables IntelliSense (e.g., SNIPPETS.App.prsub).
You can safely delete the SNIPPETS module anytime via the Delete Module button.
📁 Library Structure
Snippets are organized into functional categories for easy navigation: