Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

285
Views
How to remove focus from an Apps Script image button (Google Sheets)

I have a couple of buttons automating workflow on a Google Sheet.

After the assigned script has run, the image/button keeps keyboard focus. It only loses focus by pressing the escape key.

I haven't been able to find a programatic way to remove focus so I can get busy on the keyboard right away. There is one 'workaround' on here that opens then closes a sidebar but this is anything but elegant AND requires unncessary user permissions.

Any ideas?

[edited to add: .activate() and .setActiveSelection(range) do NOT remove focus from the image]

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

.activate will fit your needs.

var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
sheet.getRange('A1').activate;

//Or this to go to the first empty cell in col A

var lastRow = sheet.getLastRow();
sheet.getRange(lastRow+1,1).activate;
about 4 years ago · Juan Pablo Isaza Report

0

The answer to this question is: There is currently no functionality to do this as of September 2021.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!