Returns the starting row index of a range.
class SpreadsheetApp method .getRow()
SpreadsheetApp is the Apps Script service.
.getRow() is the method name you will see after a dot in your code.
What it does
Why it's used
- Figure out which row a cell sits on for row-based logic.
- Skip or highlight rows based on position in the sheet.
Common errors
- Forgetting parentheses on getRow. Write SpreadsheetApp.getRow(), not SpreadsheetApp.getRow or getRow by itself.
- Skipping dots between chained calls. Each step needs a dot, like SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Data').getRow().
- Adding spaces where they do not belong. Write SpreadsheetApp.getRow(), not SpreadsheetApp .getRow(), SpreadsheetApp.getRow (), or SpreadsheetApp . getRow().
- Wrong capitalization. Use SpreadsheetApp and getRow, not spreadsheetapp or getrow.
Snippets using this method
- Visicalc 2023 Design Walkthrough
- Visicalc 2023 Quick Walkthrough
- Tweet From a Sheet
- Simple Inventory Management Automations
- Sync Tabs in Different Sections
- Sync Many Tabs without ImportRange()
- Timestamp When Done (With Code)
- Shaman: AI Blog Writer
- Twitter App Clone in a Google Sheet
- Sync Two Tabs Without ImportRange()
- Track Every Edit (Almost)
- Reformat Pasted Cells Automatically
- Saving OpenAI API Calls inside of Google Sheets
- Make AI-generated Poems Based on Name
- Move Entire Row when a Cell is changed to "Yes" - The $75,000 Google Script
- How to Power Testimonials with Google Forms and Sheets
- Google Maps Scraper for Outreach
- Enter Google Drive File Name Get URL
- How To Change Date Format Automatically
- How to Copy To New Tab When Checked
- Highlight Row as You Move Your Cell Selection
- CRM Automations
- Create Your Own NIGHT Mode (like PRIDE)
- Creating a Live Message in Google Sheets
Explore
Related methods
-
.getColumn()
Returns the starting column index of a range.
-
.getRange()
Returns a range of cells by A1 notation or row and column numbers.
-
.getNumRows()
Returns how many rows are in a range.
-
.offset()
Returns a range shifted by a number of rows and columns.
-
.getLastRow()
Returns the row number of the last row that has content.
More Apps Script
Better Sheets tutorials
Add Tasks to Google Tasks From Google Sheets
Automated Project Management in Google Sheets
Automate Form Response to Confirmation Email
Automate Google Sheets With Zero Experience
Automatically Check Past Stages
Basic CRM - Add a Powerful Script To Move Row Based on Status
Build a Case Converter From Scratch
Build Your Own AI Writer in Google Sheets
Built a Cookie Clicker Clone in Google Sheets
Create an Automated Task List
Create a Radio Button From Checkboxes Using Google Apps Script
Create a Stop Watch in a Google Sheet
Create a Timer with Apps Script
Create a Waterfall of AI Prompts and Responses
Create Your Own NIGHT Mode (like PRIDE)
Create Your Own Pride Flag Easter Egg in Sheets
Creating A Dark Mode Theme | Announcing Dark Habits
Creating a Live Message in Google Sheets
CRM Automations
Deep Inside Dark Habits Google Script
Enter Google Drive File Name Get URL
Google Maps Scraper for Outreach
Highlight Row as You Move Your Cell Selection
How To Change Date Format Automatically
How to Copy To New Tab When Checked
Make AI-generated Poems Based on Name
Move Entire Row when a Cell is changed to "Yes" - The $75,000 Google Script
Reformat Pasted Cells Automatically
Saving OpenAI API Calls inside of Google Sheets
Shaman: AI Blog Writer
Simple Inventory Management Automations
Sync Tabs in Different Sections
Sync Two Tabs Without ImportRange()
Timestamp When Done (With Code)
Track Every Edit (Almost)
Tweet From a Sheet
Visicalc 2023 Design Walkthrough
Related blog posts
Written guides about SpreadsheetApp.getRow().
What's Better Than Google Sheets?
Nothing is better than Google Sheets. You just need to learn more about the unlimited power of Google Sheets. Functions, Formulas, Apps Script and more.
Read post →How to Use Google Sheets as a Website Database
Did you know you can use Google Apps Script to turn a Google Sheet into a free, auto-syncing database for your website? This guide shows you exactly how to set it up. You’ll prepare your spreadsheet, write a few lines of code and publish your site. Don’t worry if you’re not a developer, we’ll walk you through it. Why Use Google Sheets as a Database? For small projects, Google Sheets offers many advantages over traditional databases: * Free hosting and storage * Easy to edit data without...
Read post →How to reference a different Google Spreadsheet in Apps Script?
Transferring Data Between Cells in Different Spreadsheets
Read post →