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 Extensionsand then Macrosand 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 Toolsand then Script editor.

To perform a macro, click Extensionsand then Macrosand thenthe 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 Extensionsand then Macrosand then Manage macros.
  3. Make your changes. To remove a macro or edit the script, next to a macro, click MoreMore
  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 Toolsand then  Script editor.
  3. At the top, click Editand then  Current project's triggers.
  4. At the bottom right, click Add triggerand 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 Extensionsand then Macrosand 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
3742493397015119538
true
Search Help Center
true
true
true
true
true
35
false
false
false
false
Design a Mobile Site
View Site in Mobile | Classic
Share by: