The closest thing you can have is the following script.
Code
function onOpen() {
SpreadsheetApp.getUi().createMenu("Harmonize")
.addItem("Go !!", "mySheets").addToUi();
}
function mySheets() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
// retrieve number of sheets
var nshs = ss.getNumSheets();
// find first sheet
for(var i=0; i<nshs; i++) {
var sh = ss.getSheets()[i];
if(sh.getIndex() == 1) {
var aCell = ss.getActiveCell().getA1Notation();
var index = i;
}
}
// set active range throughout the sheets
for(var j=0; j<nshs; j++) {
if(ss.getSheets()[j].getIndex() != 1) {
ss.getSheets()[j].setActiveSelection(aCell).activate();
Utilities.sleep(200);
}
}
// return to first sheet
ss.getSheets()[index].setActiveSelection(aCell).activate();
}
Explained
Upon opening, a menu item is created. Selecting this item, will execute the mySheet
function. This will find the first sheet (doesn't need to be getSheets[0]
) and its index
plus the A1Notation()
. After that, it will set the active selection of each sheet according to the first sheet.
Example
I've created an example sheet for you: Set Selection throughout all sheets