Automate tasks in Google Sheets

You can save time by automating repetitive tasks with macros.

Create a macro

  1. On your computer, open a spreadsheet at sheets.google.com.
  2. At the top, click Tools and then Macros and then Record macro.
  3. At the bottom, choose which type of cell reference you want your macro to use:
    • Use absolute references: The macro will do tasks on the exact cell you record. For example, if you bold cell A1, the macro will only ever bold cell A1 regardless of which cell you clicked.
    • Use relative references: The macro will do tasks on the cell you select and its nearby cells. For example, if you record bolding cells A1 and B1, the macro can later be used to bold cells C1 and D1.
  4. Complete the task you want to record. When you’re done, click Save.
  5. Name the macro, create a custom shortcut, and click Save.
    • Note: When you create a macro in Google Sheets, an Apps Script is created. To edit this Apps Script, at the top, click Tools and then Script editor.

To perform a macro, click Tools and then Macros and then the macro you want.

Edit your macros

  1. On your computer, open a spreadsheet at sheets.google.com.
  2. At the top, click Tools and then Macros and then Manage macros.
  3. Next to a macro, click More More. Rename or remove the macro.
  4. When you’re done, click Update.

Import custom functions

You can import custom functions made with Google Apps script.

  1. On your computer, open a spreadsheet at sheets.google.com.
  2. At the top, click Tools and then Macros and then Import.
  3. Next to the function you want to import, click Add function.
Was this article helpful?
How can we improve it?