class SpreadsheetApp method .getRange()

SpreadsheetApp is the Apps Script service.

.getRange() is the method name you will see after a dot in your code.

What it does

Returns a range of cells by A1 notation or row and column numbers.

Why it's used

  • Target a specific block of cells like B2:D50 for reading or formatting.
  • The starting point for almost any cell read, write, or style change.

Common errors

  • Forgetting parentheses on getRange. Write SpreadsheetApp.getRange(), not SpreadsheetApp.getRange or getRange by itself.
  • Skipping dots between chained calls. Each step needs a dot, like SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Data').getRange().
  • Adding spaces where they do not belong. Write SpreadsheetApp.getRange(), not SpreadsheetApp .getRange(), SpreadsheetApp.getRange (), or SpreadsheetApp . getRange().
  • Wrong capitalization. Use SpreadsheetApp and getRange, not spreadsheetapp or getrange.

Explore

Related methods

  • .getA1Notation()

    Returns the A1-style address of a range, like B2:D10.

  • .getRow()

    Returns the starting row index of a range.

  • .getColumn()

    Returns the starting column index of a range.

  • .getDataRange()

    Returns the smallest range that contains all data on the sheet.

  • .offset()

    Returns a range shifted by a number of rows and columns.

Better Sheets tutorials

2 New Ways To Add Emoji Reactions

2 New Ways To Add Emoji Reactions

 Revolutionize the way you react with emojis! Discover two new methods t...
5 Ways To Use Google Sheets for Advanced Project Management

5 Ways To Use Google Sheets for Advanced Project Management

Here are 5 advanced ways to manage projects inside of Google Sheets Man...
Access the Dictionary API to get Definitions for Words in Google Sheets

Access the Dictionary API to get Definitions for Words in Google Sheets

Add Click Tracking To Your Google Sheets | Bitly in a Google Sheet

Add Click Tracking To Your Google Sheets | Bitly in a Google Sheet

Create a click Edit: Google changed how the redirect is handled. It no l...
Add NPS to Your Google Site

Add NPS to Your Google Site

Create buttons on your Google Site to get an NPS, or Net Promoter Score ...
Add Tasks to Google Tasks From Google Sheets

Add Tasks to Google Tasks From Google Sheets

Create tasks in Google Tasks from Google Sheets using Apps Script
Anika Asks: How To Set Text Overflow All The Time

Anika Asks: How To Set Text Overflow All The Time

Learn to set text wrap, overflow, or clip. Great for designing better te...
Automated Project Management in Google Sheets

Automated Project Management in Google Sheets

Create automatic notifications when a project is assigned, a project nee...
Automate Emails

Automate Emails

Set up automated email notifications based on Google Sheets data. Super ...
Automate Form Response to Confirmation Email

Automate Form Response to Confirmation Email

Create an email automatically when someone fills out a google form. incl...
Automate Google Sheets With Zero Experience

Automate Google Sheets With Zero Experience

By the end of this video you should be knowledgeable about how to automa...
Automate Help Desk Ticket Closing

Automate Help Desk Ticket Closing

Create a simple automated help desk ticketing system. • Create tickets C...
Automate Move Blank Rows

Automate Move Blank Rows

Automate the apps script we just created that moves blank rows from one ...
Automatically Align Top

Automatically Align Top

Automate formatting cells to align top. Either by a time-based trigger o...
Automatically Check Past Stages

Automatically Check Past Stages

Create an automation that runs whenver we check off a checklist item the...
Automatically Clear Content | Refresh Reuse Recycle Templates

Automatically Clear Content | Refresh Reuse Recycle Templates

Create automatic functions to clear content.
Automatically Copy Spreadsheet Tab to New File with Values Only, No Formulas

Automatically Copy Spreadsheet Tab to New File with Values Only, No Formulas

Automatically copy a spreadsheet tab to a whole new spreadsheet file, ge...
Automatically Uncheck A Daily Checklist

Automatically Uncheck A Daily Checklist

Create an automatic unchecker for a daily checklist. Fun way to learn Ap...
Automatic Calculations

Automatic Calculations

Create custom scripts to make your spreadsheets more like tools.
Basic CRM - Add a Powerful Script To Move Row Based on Status

Basic CRM - Add a Powerful Script To Move Row Based on Status

we're going to be adding a very powerful script to our CRMs or any datab...

Related blog posts

Written guides about SpreadsheetApp.getRange().

Browse the blog