This tip will show you how to copy an Excel Macro into your workbook or spreadsheet. You will learn the different locations that you might install the macro as well as what you need to make sure is included in the macro for it to work.
First - Every macro must start and end like the example below:
Sub The_Name_of_The_Macro()
The code for the macro goes here.
End Sub
Every macro in Excel must start with "Sub" and end with "End Sub." The name of the macro must have an open and closed parenthesis right after it. You can name the macro anything that you want but you should make it describe the function of the macro. All of the actuall code for the macro comes after the name of the macro and before "End Sub."
Second - There are a number of different places where you can install a macro in Excel and you need to know this before you install the macro. You can install a macro ino a Module, Worksheet, or Workbook - See Image Below.
How to install the Macro into Excel - Steps
This is what the macro should look like once installed: