Friday, August 17, 2012

Google Spreadsheet - How to quickly scroll down to desired row - Option 1

If you are having a huge amount of rows in your spreadsheet, then you must be wondering how to navigate to your desired row immediately, there are various ways to achieve it. You can scroll if down with the help of a mouse, but take lots of time and you can press "Page Down" key, but sometimes if there are rows in thousands then it will also take your time to navigate.

Following is the script which will help you to navigate to your desired "Cell":

function onOpen()
{
  var sheet = SpreadsheetApp.getActiveSpreadsheet();
  var entries = [{name:"MyFunction", functionName:"myFunction"}];
  sheet.addMenu("Scripts", entries);
};

function myFunction()
{
  var ss = SpreadsheetApp.getActiveSpreadsheet();
  var mysheet = ss.getActiveSheet();

  var input = Browser.inputBox("Input", "Input Row No. To Navigate:", Browser.Buttons.OK);
  mysheet.setActiveCell(mysheet.getDataRange().offset(input-1, 0, 1, 1));
};


As soon as you input the row number, you will be navigated to the "Cell" which is at the first Column in that row.

And in "onOpen()" function, I have coded to insert "myFunction" in the "Scripts" menu at the menu bar. I have entered this function in the script so that you don't have to run the script from script editor again and again and so that you can do it directly from the menu bar.

So now you can navigate or scroll to the desired row.

Here is the option to directly navigate to the last row by default:
http://igoogledrive.blogspot.com/2012/08/scroll-down-to-last-row.html


You can also navigate to your last modified cell, here is the script for it:
http://igoogledrive.blogspot.com/2012/08/how-to-get-location-of-last-modified.html 

No comments:

Post a Comment