P
P
Petro25612021-01-19 12:33:52
Google Sheets
Petro2561, 2021-01-19 12:33:52

How to make Google spreadsheet open in the right place?

Good afternoon!
I go to Google Sheets by bookmark, the desired sheet opens, but always at the beginning of the sheet. I would like the sheet to open in the same place where it was last closed. Or in the actual place, as it happens in excel. What do you advise?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
G
Grigory Boev, 2021-01-19
@ProgrammerForever

Right click - Get link to this cell
6006a931f32a6032473491.png

A
Aleksei Shebanits, 2021-01-19
@shebanits

function onEdit(e){
  let row = e.range.getRow();
  let column = e.range.getColumn();

  let cache = CacheService.getScriptCache();
  cache.putAll({
    "row": `${row}`,
    "column": `${column}`
  });
}

function onOpen() {
  let cache = CacheService.getScriptCache();
  let sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
  let row = cache.get("row");
  let column = cache.get("column");
  sheet.getRange(+row, +column).activate();
  SpreadsheetApp.flush();

}

Z
zork1991, 2021-01-19
@zork1991

Put 2 triggers onedit and onopen.
During the first one, write the address of the active cell to the cache; while executing the second, go to the address of the active one. In order to avoid resources, you can write a script instead of onedit, which will be launched by hot keys, just press the key combination every time before exiting.

K
k9t, 2022-03-02
@k9t

Does not work. What could be the problem ? Or am I doing something wrong?
621f603caf7b8021141799.png

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question