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 Extensions 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.
  1. Complete the task you want to record. When you’re done, click Save.
  2. 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 Extensions and then Macros and then the macro you want.

Edit your macro

You can change the name, add a keyboard shortcut, edit the script, or remove a macro.

  1. On your computer, open a spreadsheet at sheets.google.com.
  2. At the top, click Extensions and then Macros and then Manage macros.
  3. Make your changes. To remove a macro or edit the script, next to a macro, click More More
  4. Click Update.

Schedule your macro

You can set your macro to run based on actions, calendar updates, time intervals, or a chosen time and date.

  1. On your computer, open a spreadsheet at sheets.google.com.
  2. Click Tools and then Script editor.
  3. At the top, click Edit and then Current project's triggers.
  4. At the bottom right, click Add trigger and select your options.
  5. Click Save.

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 Extensions and then Macros and then Import macro.
  3. Next to the function you want to import, click Add function.
true
Visit the Learning Center

Using Google products, like Google Docs, at work or school? Try powerful tips, tutorials, and templates. Learn to work on Office files without installing Office, create dynamic project plans and team calendars, auto-organize your inbox, and more.

Search
Clear search
Close search
Google apps
Main menu