A macro is any public subroutine in a code module. A function or a private subroutine cannot be a macro, and a macro cannot be located in a class or form module.
To create a new macro
The template for the macro subroutine appears in the code module window.
For more information about using the Visual Basic Editor, see the online Help in the editor.
Once you’ve created a macro, you can create a menu item or toolbar button that will run the macro when you click it.