How Macros in Google Sheets Work
On your computer, open a spreadsheet at sheets.google.com.
At the top, click Tools > Macros > Record macro.
At the bottom, choose which type of cell reference you want your macro to use:...
Complete the task you want to record. ...
Name the macro, create a custom shortcut, and click Save.