Enable the Developer tab in Excel
Go to File > Options > Customize Ribbon
Check the Developer box and click OK
Open the Developer tab
Click Record Macro
Enter a macro name
Choose a shortcut key if desired
Select where to store the macro
Add a description if needed
Click OK
Perform the actions you want to automate
Click Stop Recording on the Developer tab
Open the Visual Basic Editor with Alt + F11
Insert a new module if you want to write or edit code manually
Write or modify the VBA macro code
Save the workbook as a macro-enabled file
Use the macro from the Developer tab, shortcut key, or assigned button
