In this article:

How to Have Google Sheets Open to the Last Edited Cell

October 29, 2024

In this article, we will show you exactly how to set up Google Sheets to open to the last edited cell. Simply follow the steps below.

google sheets open to last edited cell

How to Get Google Sheets to Open at the Last Edited Cell

Follow the steps below to have Google Sheets open to the last edited cell.

1. Open the Script Editor to Create a Custom Script

Go to the “Extensions” menu and select “Apps Script.” This opens a new window where you can write your custom script directly in Google Sheets.

No need to download anything as you can work within this built-in editor.

last edited cell in Google Sheets

2. Paste the Script to Track the Last Edited Cell

Delete any existing code in the script editor and paste the following:

function onEdit(e) {

  const sheet = e.source.getActiveSheet();

  const range = e.range;

  const lastEditedCell = range.getA1Notation();

  const lastEditedSheet = sheet.getName();

  

  PropertiesService.getScriptProperties().setProperty('lastEditedCell', lastEditedCell);

  PropertiesService.getScriptProperties().setProperty('lastEditedSheet', lastEditedSheet);

}

function openToLastEditedCell() {

  const properties = PropertiesService.getScriptProperties();

  const lastEditedCell = properties.getProperty('lastEditedCell');

  const lastEditedSheet = properties.getProperty('lastEditedSheet');

  const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(lastEditedSheet);

  SpreadsheetApp.setActiveSheet(sheet);

  sheet.setActiveRange(sheet.getRange(lastEditedCell));

}

This code saves the last edited cell and sheet name whenever you make an edit.

go to the last edited cell in Google Sheets

3. Save the Script

Click the disk icon to save the script. Name your project something recognizable, like “Last Edited Cell Tracker.”

last modified cell in Google Sheets

4. Set Up a Trigger for the Script

Click on the clock icon (Triggers) in the left sidebar. Click “Add Trigger,” select the "openToLastEditedCell" function, and set it to run on the event type “On open.” After that, click “Save” to confirm.

This ensures the script runs every time you open the document.

open Google Sheets to last edited cell

5. Bypass or Set Up Email Notifications for Changes

When prompted to send an email, enter an email address to receive notifications about changes. Make sure to follow this step, as it is important for moving on to the next step.

access last edited cell in Google Sheets

6. Test the Script

Make an edit in your Google Sheet, close the document, and reopen it. If set up correctly, it should take you to the last edited cell.

You can check if the script works by editing a cell and then reopening the file.

access last edited cell in Google Sheets

We hope that you now know how to open Google Sheets at the last edited cell. If you enjoyed this article, you might also like our articles on how to request edit access in google sheets and how to copy a google sheet.

Get Google Sheets productivity and automation tips delivered straight to your inbox
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
We'll email you 1-3 times a week — and never share your information.

Work less, automate more!

Use Lido to connect your spreadsheets to email, Slack, calendars, and more to automate data transfers and eliminate manual copying and pasting. View all use cases ->