Reputation: 11
I have large google sheet-sheet, where would be nice that active cell would come to top left corner in the sheet. I have found solution in Excel (https://www.extendoffice.com/documents/excel/5117-excel-active-cell-top-screen.html) so I have been wondered that is similar possible in google sheet? Could anybody help me with that?
Upvotes: 1
Views: 892
Reputation: 1
Activate a cell beyond that cell, use SpreadsheetApp.flush() to update the UI and then activate the good cell.
Upvotes: 0
Reputation: 517
I've updated my code to be more explicit as to how to run and test the .setActiveSelection() function.
You should be able to use the following:
function setActiveCellFunction() {
var test = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet().getActiveCell().getA1Notation();
Logger.log(test);
SpreadsheetApp.getActiveSpreadsheet().getActiveSheet().setActiveSelection("A1");
var test = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet().getActiveCell().getA1Notation();
Logger.log(test);
}
The results from the two Logger.log() calls are as follows:
[19-08-05 08:54:26:287 EDT] D8
[19-08-05 08:54:26:291 EDT] A1
Upvotes: 1