Home                                               ​ AutoMacro: VBA Code Generator


AutoMacro: VBA Code Library

  • Extensive VBA Code Library - Over 200 ready-to-use code fragments
  • Create Your Own VBA Code Library - Create your own code library by saving your own frequently used code fragments
  • Share your VBA code library with colleagues
  • VBA Code Generators to generate code for your unique circumstances!
Features Experienced VBA Users will love:

Looking for our list of VBA Code Examples?  Visit this page instead.

What is AutoMacro?

AutoMacro is an add-in that installs directly into the Visual Basic Editor:


It comes loaded with code generators, an extensive code library, the ability to create your own code library, and other time-saving features.

AutoMacro's Code Library

vba library of code

AutoMacro contains a vast code library of over 200 pieces of VBA code.

Easily access the code through the code menus that install directly into the top of the Visual Basic Editor.

Simply click your desired code and it will be inserted directly into your active VBA module.

Save Your Own Code and Build Your Own Code Library

Create your own Code Library by saving your own commonly used code fragments.

Simply highlight the code, click "Add Code", and your code will be saved for future use.

Custom Code fragments are saved to a folder accessible on your hard drive. You can add folders to organize your code, or change the folder location.

You can even set the Custom Code folder location to a shared network drive, allowing your team to easily share code.

save your own custom vba code

Other Features


VBA Code Generators - Sometimes pre-built code is not enough. Instead, you need a code generator that will generate code based on your unique needs.

VBA Code Formatter - Cleanly indent code, remove excess line breaks, or comment multiple lines of code with just a press of the button.

Other Time-Saving Features - Many other time-saving features and tools!

Why Wait?

  • Stop searching for code online
  • Save your own code fragments
  • Get more done in less time!

Insert Code From AutoMacro's Code Library

Simply navigate to the Code Library's menus, select your desired code, and it will be inserted directly into your active module!

inserted sample code

Code Library Examples


  • The settings menu contains VBA and Excel settings including:
    • ScreenUpdating
    • Automatic Calculations
    • Events
    • Error Handling
    • and much more
  • Pro-Tip: Even if you know the syntax, make use of the keyboard hotkeys and save some keystrokes 
vba code example
vba code examples
vba automatic code creator

Ifs, Selects, Fors, Loops, and Message Boxes

  • Fors and Loops are essential to automating repetitive processes. However when you first start coding, the exact syntax can be hard to remember.
  • AutoMacro allows you to easily insert 5 of the most common types of loops, allowing you to adapt them to your needs.
  • Insert examples of Ifs and Case Selects - If you aren't familiar with these essential VBA commands, insert an example and adapt the code to your needs.
  • Message Boxes and Input Boxes allow you to easily communication information to the user, or receive information from the user. Easily insert them with AutoMacro.


  • Functions to work with files: Does a file exist?, Get file name from path, and unzip files.
  • The Files menu contains code to manipulate files
  • The Folders menu contains code to work with folders
  • SpecialFolders provides code to access MyDocuments and other special folders
  • The TextFiles menu contains code to work with text files allowing you to load them into VBA's memory, edit them, and more.
examples of vba code
library of vba code


  • Does a specific Sheet & Range exist? TRUE / FALSE
  • Does a file exist? TRUE / FALSE
  • Standard start & end procedure declarations

Text, Dates, and Times

  • VBA comes with many tools for working with text, dates, and times.
  • AutoMacro provides examples for you to reference
vba code addin

Object Code Library

Most Excel VBA work is manipulating objects like Ranges, Sheets, and Workbooks. You manipulate these objects by either applying a method (an action like Copy or Paste) or a property (cell value or cell color). 

With a click of the mouse in AutoMacro you can apply a method or property to an object.




Columns and Rows

The Object Builder (and all other code), can be programmed to use Object Variables or the currently active objects

Active Objects

Object Variables

Create Your Own Code Library

Save your own Custom Code and create your own Code Library:

1. Highlight your code

vba code sample

3. Name your code fragment and click 'Save'

save vba code example

2. Custom Code > Add Code

vba add code sample

4. Now your code appears in the Custom Code Library

insert code sample code

Share Your Code Library with Your Team

Your custom code library is saved to a folder on your hard drive. You can change the folder location to a shared network drive, allowing your colleagues to access to Code Library.

You can also add folders and organize your code so that your code is easy to access!

Used by productive employees at...

VBA library code

*AutoMacro has been used by employees of these organizations. These organizations do not endorse, approve, sponsor, or otherwise have any affiliation with this website, Spreadsheet Boot Camp LLC, or ToolFive Software LLC. 

What are you waiting for?

Use AutoMacro's Code Library and other features to save time and increase your productivity!