Google Sheets Apps Script Extension: Setup and Use

How-to basics · Updated November 3, 2026

Google Sheets Apps Script Extension: Setup and Use

Google Apps Script is built into Google Sheets; you do not need to install a separate extension to use it. In a spreadsheet open in a web browser, choose Extensions > Apps Script to open the editor and create a script for that file.

Where to find Apps Script in Google Sheets

Open the spreadsheet in the desktop version of Google Sheets, then look in the top menu for Extensions > Apps Script. The script editor opens in a browser tab. The project is associated with the spreadsheet when you open it this way, so it can work with that file through Google’s spreadsheet services.

If you do not see the menu item, check that you are working in Google Sheets rather than viewing an Excel file in compatibility mode, and that you have permission to edit the spreadsheet. Menu availability can also be affected by account policies set by a school or workplace administrator. The Google Sheets mobile app does not provide the full Apps Script editor; use a desktop browser to write and manage scripts.

“Extension” can mean two different things here. Apps Script appears inside Sheets’ Extensions menu, but it is a scripting tool, not a browser add-on that you install from a store. A Google Sheets add-on is a separate product that you can install, while a script is code you write or obtain and authorize.

What Apps Script does

Apps Script is Google’s cloud-based JavaScript platform for automating and extending Google products. In a Sheets project, code can read and edit spreadsheet cells, create menus and dialogs, respond to certain events, and connect to services such as Drive or Gmail when the code and account permissions allow it.

It is useful when a repeated task is too specific for a built-in feature. For example, a script might add a menu item that cleans up selected data, copy completed rows to an archive tab, or send a reminder when a process reaches a defined point. It can also support custom functions, which you enter in cells like spreadsheet formulas, although those functions have restrictions and are not a replacement for every built-in formula.

Apps Script runs on Google’s servers, rather than as a program installed on your computer. That means an automation can interact with Google services without you keeping a desktop application open, but it also means scripts are subject to Google’s authorization rules and execution quotas.

How a spreadsheet script is connected

A script opened through a spreadsheet’s Extensions menu is usually a container-bound script: it is linked to that particular spreadsheet and can use its interface. For example, it can add a menu to the file or refer to the current spreadsheet. It is stored as a project in Google Drive, not as code embedded in an Excel workbook.

A standalone script is a separate Apps Script project in Drive. It can still access a spreadsheet if the code is given the spreadsheet’s ID and has the required authorization, but it is not automatically tied to one file’s menus. Choose a bound project for a tool meant to live with one spreadsheet; consider a standalone project for automation managed separately or intended to work across files.

Apps Script projects can also be shared, but sharing code and sharing the spreadsheet are separate decisions. Someone who can edit a bound script may be able to change the automation, while spreadsheet access determines what they can do in the file itself. Review both access lists when a spreadsheet contains sensitive data.

Make a simple custom menu

A practical first project is a small menu in the spreadsheet. In the Apps Script editor, replace the starter code with the following, save the project, and reload the spreadsheet:

function onOpen() {
  SpreadsheetApp.getUi()
    .createMenu('Sheet tools')
    .addItem('Show active cell', 'showActiveCell')
    .addToUi();
}

function showActiveCell() {
  const cell = SpreadsheetApp.getActiveRange();
  SpreadsheetApp.getUi().alert('Active cell: ' + cell.getA1Notation());
}

When the spreadsheet opens, the simple onOpen trigger adds a menu called “Sheet tools.” Choose its “Show active cell” item to display the active cell’s address, such as B4. This example illustrates the basic pattern: a trigger adds an interface, and a named function performs the action.

To run a function directly from the editor, select its name in the function selector and click Run. The first run of a script that needs protected access may prompt you to review and authorize permissions. For the menu example, saving and reopening the spreadsheet is the simplest way to see the menu appear.

Common uses and when a script helps

Before writing code, check whether a built-in Sheets feature already solves the task. Filters, data validation, conditional formatting, pivot tables, and formulas are easier for many everyday jobs and are visible to other spreadsheet users without requiring them to understand custom code. Apps Script becomes more valuable when you need a repeatable workflow, a custom control, or coordination with another Google service.

  • Repetitive cleanup: standardize text, remove blank rows, or apply a consistent format to a defined range.
  • Workflow actions: add a menu command that archives finished records or prepares a report from selected rows.
  • Notifications: send an email based on a condition, provided the script has the relevant authorization and is configured appropriately.
  • Custom functions: create a calculation for a specialized need, while remembering that custom functions have limitations compared with ordinary script functions.

For instance, a small club could use a menu action to copy rows marked “Paid” from a registration tab into an archive tab at the end of a month. A script could make the operation consistent, but the design still needs safeguards: define which columns to copy, avoid archiving the same row twice, and test on a copy before using real records.

Permissions, privacy, and safe use

Scripts can request access to data or services under your Google account. The authorization screen explains the requested access at a high level; read it carefully and make sure it matches what the script is supposed to do. A simple script that only edits its own spreadsheet may need less access than one that sends email or reads files in Drive.

Code written by someone else deserves extra scrutiny. Do not paste a script into a sensitive spreadsheet simply because a website recommends it. Review what it reads, changes, sends, or stores, and avoid granting broad permissions to code you do not trust. If an organization manages your account, its administrator may restrict Apps Script or particular services.

Simple triggers, such as onOpen, run automatically in limited circumstances and cannot use services that require user authorization. Installable triggers can perform more tasks after you authorize them, but they run under the account of the person who created the trigger. That distinction matters if staff share a spreadsheet: a trigger does not automatically run as every person who opens the file.

Quotas and practical limits

Apps Script has quotas and service-specific limits. These can restrict execution time, how often a trigger runs, or how many calls a script makes to a service. Limits vary by account type and service, and Google can update them, so check the current Apps Script quotas documentation before designing a high-volume or business-critical automation.

For a small personal spreadsheet, limits may never be an issue. A script that loops through thousands of cells one at a time, repeatedly opens files, or sends many messages is more likely to run slowly or reach a quota. Efficient scripts generally read a range into memory, process the values, and write results back in batches rather than making a separate spreadsheet request for every cell.

Also plan for failures. A trigger can stop working if its creator loses access, revokes authorization, or reaches a limit. For important workflows, keep a manual fallback, log meaningful errors, and periodically confirm that the automation still runs as intended.

Apps Script versus add-ons and macros

Use an add-on when you want a ready-made tool with a maintained interface and do not need to own its code. You can look for available Google Sheets add-ons through Extensions > Add-ons > Get add-ons, where available. Check the publisher, requested permissions, reviews, and any subscription terms before installing one.

Use Apps Script when you need a tailored process or want to control the code. It offers flexibility, but you are responsible for testing, authorization, and maintenance. A script copied from an example is not automatically a supported product, and changes to a spreadsheet’s layout can break assumptions in the code.

For a small repeatable action, the macro recorder may be enough. In Sheets, use Extensions > Macros > Record macro to record supported actions; Sheets saves the macro as Apps Script code. The recorder is convenient for straightforward formatting or editing sequences, but it cannot capture every decision or workflow. A macro and a hand-written Apps Script are part of the same broader scripting environment, not separate browser extensions.

Apps Script is specific to Google’s ecosystem. It does not run inside Microsoft Excel as an Excel add-in or VBA macro. If the intended users work in Excel, investigate Excel’s own automation options instead; moving a Google Sheets script to Excel usually requires rewriting it.

Common problems and fixes

  • The menu does not appear: save the project, reload the spreadsheet, and confirm that the function is named exactly onOpen. Check that you opened the script from the correct spreadsheet.
  • A function asks for authorization: review the requested access and authorize only if you trust the code and the request fits its purpose. Some triggers require a one-time authorization or must be created as installable triggers.
  • The script says it cannot find a range or sheet: check tab names, cell references, and whether the active selection exists. A renamed tab can invalidate code that uses its old name.
  • A trigger works for one person but not another: verify who created the installable trigger and what access that account has. Triggers run in the context of their creator.

When debugging, open the Apps Script editor and inspect the execution details or error message. Test changes on a duplicate spreadsheet, especially if the code deletes rows, overwrites values, or sends messages. A backup gives you a recovery path if the script’s assumptions are wrong.

Frequently Asked Questions

Is Google Apps Script a Chrome extension?
No. It is a Google-hosted scripting platform available from the Extensions menu in Sheets. A Chrome extension is installed in the browser; Apps Script code is saved in a Google Drive project and runs through Google services.

Is Apps Script free to use with Google Sheets?
There is generally no separate charge to open the Apps Script editor for ordinary use with a Google account, but quotas apply. Some Google Workspace plans, third-party add-ons, or services connected to a project may involve separate costs or administrator policies.

Can I use Apps Script on my phone?
You can open and edit spreadsheet content in the Sheets mobile app, but it does not provide the full Apps Script editor for writing and managing projects. Use a desktop browser for the editor and script setup.

How do I run a Google Sheets script?
Open Extensions > Apps Script, choose a function in the editor, and click Run. For scripts with a custom menu or trigger, follow the script’s setup instructions; the first run may require authorization.

Does Apps Script work in Excel?
No. Apps Script is designed for Google products, including Google Sheets. Excel uses different automation tools, so a script normally needs to be adapted or rewritten for an Excel workflow.

Related

Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.

More in How-to basics

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.