How can I jump to the last cell with data in a column in Google Sheet?

To get this to work 100% of the time you’d need to write a custom script function to do this. Everyone’s previous suggestion of using CTRL + DOWN works fine unless you have a blank cell somewhere in the column.

I already did this at work for one sheet, so here you go.

function onOpen(e) {
var ui = SpreadsheetApp.getUi();
ui.createMenu(‘Script Functions’).addItem(‘Go to End’, ‘end’).addToUi();
}
function end() {
var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
var lastRow = sheet.getDataRange().getValues();
lastRow.forEach(function (row,index) {
if (row[0] == “”) {  // row[0] is the same as Column A. row[1] = B
lastRow.length = index;
}
});
var newRange = sheet.getRange(lastRow.length,1);
sheet.setActiveRange(newRange);
}

To get this to work you need to go to Menu >> Tools >> Script Editor and paste and save this into the Script Editor. Then, reload your sheet. You’ll now have a new Menu item called Script Function that has a command called Go to End. Click that and it’ll go to the end of Column A. If you need a different column edit line 11.

And I know this looks like it’s ignoring Google Sheet’s .getLastRow() function, but that’s because if you have a formula pulled down through an entire column it will throw a false positive to the .getLastRow() function and always return the last row in a Sheet. This script works regardless of whether or not you have formulas in cells.

Leave a comment

Your email address will not be published. Required fields are marked *