Search this site
Embedded Files
Google Workspace Guide
  • Home
  • Learning Series
    • What to do on Day 1
    • Your first week & beyond
    • Cheat Sheets
      • Gmail
      • Calendar
      • Drive
      • Chat
      • Sheets
      • Meet
      • Documents
      • Slides
  • Quick Tips
  • FAQs
    • SHEET
    • DRIVE
    • GMAIL
    • CHAT
    • MEET
    • DOC
    • SLIDES
    • CALENDAR
  • Training
    • Training Deck
    • Training Short Videos
      • Gmail
      • Calendar
      • Drive
      • Productivity Tools
    • Training Recording
    • Training Q&A
    • Google Groups for Business
  • Contact Us
Google Workspace Guide
  • Home
  • Learning Series
    • What to do on Day 1
    • Your first week & beyond
    • Cheat Sheets
      • Gmail
      • Calendar
      • Drive
      • Chat
      • Sheets
      • Meet
      • Documents
      • Slides
  • Quick Tips
  • FAQs
    • SHEET
    • DRIVE
    • GMAIL
    • CHAT
    • MEET
    • DOC
    • SLIDES
    • CALENDAR
  • Training
    • Training Deck
    • Training Short Videos
      • Gmail
      • Calendar
      • Drive
      • Productivity Tools
    • Training Recording
    • Training Q&A
    • Google Groups for Business
  • Contact Us
  • More
    • Home
    • Learning Series
      • What to do on Day 1
      • Your first week & beyond
      • Cheat Sheets
        • Gmail
        • Calendar
        • Drive
        • Chat
        • Sheets
        • Meet
        • Documents
        • Slides
    • Quick Tips
    • FAQs
      • SHEET
      • DRIVE
      • GMAIL
      • CHAT
      • MEET
      • DOC
      • SLIDES
      • CALENDAR
    • Training
      • Training Deck
      • Training Short Videos
        • Gmail
        • Calendar
        • Drive
        • Productivity Tools
      • Training Recording
      • Training Q&A
      • Google Groups for Business
    • Contact Us

Back to Quick Tips

Use macros and add-ons

Automate tasks with macros

Automate repetitive tasks with macros in Sheets. Or, if you need custom functions, menus, or windows, you can create them with Google Apps Script.

Review macro best practices

  • Limit the number of actions in a macro for optimum performance.

  • Use macros for frequently repeated operations that don’t need much configuration.

  • Use unique macro shortcuts. You can have up to 10 shortcuts per sheet. Open additional macros from ToolsMacros.

  • Reduce macro duplication by applying a macro created for a single cell to a range of cells by selecting the full range of cells and then activating the macro. 

  • Macro scripts are specific to individual sheets and can only be used in Sheets—they won’t work in Google Docs, Forms, or Slides.

Record a macro:

  1. On your computer, open a spreadsheet at sheets.google.com.

  2. At the top, click Extensions > Macros > 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  > Script > editor.

To perform a macro, click Extensions  > Macros > the macro you want.

Create a script:

  1. Click ToolsScript editor.

  2. Create your script.

Convert Excel macros to Google Sheets

You can convert macros in Microsoft Excel spreadsheets to Google Sheets by re-creating them using Google Apps Script. Apps Script powers macros in Sheets, just like Microsoft Visual Basic for Applications  does for Excel. 

Re-create and edit a macro in Sheets using Apps Script:

  1. Make a note of the macros in your original Excel spreadsheet that you need to re-create in Sheets.

  2. In Sheets, open a spreadsheet and click Extensions>Macros>Record macro.

  3. Select the type of cell reference to use and click Save.

  4. Complete the task that you want to record and click Save.

  5. Enter a name for the macro and, optionally, a shortcut number and click Save.

  6. Click ToolsMacrosManage macros to edit your script.

  7. Next to the macro that you want to edit, click MoreEdit script.

  8. In the macros.gs section, make your changes to the code. If needed, use the Sheets Apps Script documentation or search online for the JavaScript concept that you need.

  9. Click Save macro  and close the tab to return to your spreadsheet.

  10. Repeat steps 2–7 for any additional macros that you want to re-create from your original spreadsheet.

Activate a macro in Sheets

  1. Click ToolsMacrosyour saved macro. You can also run your macro by using its keyboard shortcut.

  2. If it’s the first time you run the macro, allow authorization.

Do more with add-ons

Use ready-made add-ons to do more with Sheets. Here’s a few things you
can do:

  • Use the Data connector for Salesforce to connect with Salesforce.

  • Use Supermetrics to connect with MySQL and Oracle.

  • Use Copper CRM Custom Report Builder to integrate Copper CRM data.

  • Use Greenhouse Report Connector to integrate Greenhouse
    recruiting data.

Download add-ons:

  1. Click Add-onsGet add-ons.

  2. (Optional) To see a description of the add-on, point to it or click it for a full description.

  3. Click the add-on you want to install and click Free.

  4. If needed, review the access message and click Allow.

Import external Google Sheets data range in a given Google Sheet to fix any broken links ?

IMPORTRANGE

Imports a range of cells from a specified spreadsheet.

Sample Usage

IMPORTRANGE("https://docs.google.com/spreadsheets/d/abcd123abcd123", "sheet1!A1:C10")

IMPORTRANGE(A2,"B2")

Syntax

IMPORTRANGE(spreadsheet_url, range_string)

  • spreadsheet_url - The URL of the spreadsheet from where data will be imported.

    • The value for spreadsheet_url must either be enclosed in quotation marks or be a reference to a cell containing the URL of a spreadsheet.

  • range_string - A string, of the format "[sheet_name!]range" (e.g. "Sheet1!A2:B6" or "A2:B6") specifying the range to import.

    • The sheet_name component of range_string is optional; by default IMPORTRANGE will import from the given range of the first sheet.

    • The value for range_string must either be enclosed in quotation marks or be a reference to a cell containing the appropriate text.

For more details visit

Report abuse
Page details
Page updated
Report abuse