Returns the A1-style address of a range, like B2:D10.
class SpreadsheetApp method .getA1Notation()
SpreadsheetApp is the Apps Script service.
.getA1Notation() is the method name you will see after a dot in your code.
What it does
Why it's used
- Log or email the exact address of a problem cell.
- Pass a range reference to another function or API.
Common errors
- Forgetting parentheses on getA1Notation. Write SpreadsheetApp.getA1Notation(), not SpreadsheetApp.getA1Notation or getA1Notation by itself.
- Skipping dots between chained calls. Each step needs a dot, like SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Data').getA1Notation().
- Adding spaces where they do not belong. Write SpreadsheetApp.getA1Notation(), not SpreadsheetApp .getA1Notation(), SpreadsheetApp.getA1Notation (), or SpreadsheetApp . getA1Notation().
- Wrong capitalization. Use SpreadsheetApp and getA1Notation, not spreadsheetapp or geta1notation.
1 Snippets using this method
Explore
Related methods
-
.getRange()
Returns a range of cells by A1 notation or row and column numbers.
-
.getActive()
Returns the range the user currently has selected.
-
.getRow()
Returns the starting row index of a range.
-
.getColumn()
Returns the starting column index of a range.
-
.offset()
Returns a range shifted by a number of rows and columns.
More Apps Script
1 Better Sheets tutorials
Americano Tournament Template With Four Automations
Related blog posts
Written guides about SpreadsheetApp.getA1Notation().
Learn to Code in Google Sheets, For Programmers | For Advanced Google Sheet Users
If you know how to code, you'll learn in this step-by-step tutorial how to code in Google Sheets.
Read post →How To Use a 1-Cell Google Sheet
Introduction to Tiny Sheets a free google sheet add-on to make tiny spreadsheets. Delete unnecessary rows and columns easily.
Read post →Every Locale Listed in Google Sheets and a Tool to Save Your Sanity
If you live in a country that is not well represented with blog posts or someone makes a blog post about a Google Sheets issue, they create a Google Sheet formula and then you copy and paste it into your sheet and it has the wrong delimiter. How do you resolve that?
Read post →