V
V
Vladimir Zuev2020-06-16 10:14:37
Google Apps Script
Vladimir Zuev, 2020-06-16 10:14:37

How to highlight a range in a table?

How to highlight a range in a table?
For a visual check of working with ranges, you need to select this range visually right away in the code.
I use this code

function ActivateRange() {
   var ss = SpreadsheetApp.getActive();
  var sheet = ss.getSheetByName('Продажи на Prom ua');
  var lr = sheet.getLastRow();
  sheet.getRange(1,3, lr, 5).activate();
}

But the range is allocated only after the function has completed, and in the course of the code the range is not allocated. How can I make the range allocated during the code execution, and not after the function has completed? And is it possible?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Ivanov, 2020-06-16
@vladd56

Try to useflush

function (){
  ... < proc > ...
  ActivateRange();
  SpreadsheetApp.flush();
  ... < proc > ...
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question