Open Excel and enable the Developer tab if it is not already visible
Go to File
Select Options
Click Customize Ribbon
Check the Developer box
Click OK
On the Developer tab, click Visual Basic to open the VBA editor
In the VBA editor, click Insert
Select Module
Type or paste your macro code into the module
Save the workbook as an Excel Macro-Enabled Workbook
Return to Excel
On the Developer tab, click Macros
Select the macro you want to run
Click Run
To assign a macro to a button, go to the Developer tab
Click Insert
Choose a Button from Form Controls
Draw the button on the worksheet
Select the macro to assign to the button
Click OK
To record a macro, go to the Developer tab
Click Record Macro
Enter a macro name
Choose where to store the macro
Perform the actions you want to record
Click Stop Recording when finished
