Skip to main content
The 2024 Developer Survey results are live! See the results
67 votes
Accepted

How to use Google Tasks on the web standalone?

Use one of the following 3 approaches to open Google Tasks in a single step:   https://tasks.google.com/embed/?origin=https://calendar.google.com If you have multiple Google accounts logged in at ...
simplegamer's user avatar
  • 1,190
8 votes
Accepted

Loop through all sheets, except for specific sheet names

If you are using for loop you could use continue to terminate the execution of the current iteration. A way to implement the above by using an if statement and || (logical OR) function myFunction() {...
Rubén - Volunteer Moderator -'s user avatar
4 votes

Working With Durations In Google Apps Script

Working with date, time and specifically duration is a pain in JavaScript, and Google Sheets does not make it much easier. A JavaScript Date object (which is really a datetime object) is not suited ...
Vidar S. Ramdal's user avatar
3 votes

Hide/Unhide rows based on values in particular cells

When you have two onEdit(e) functions in the same script project, only one of them will run. The simplest pattern to combine two onEdit(e) functions is to rename the existing functions to ...
doubleunary's user avatar
  • 15.1k
3 votes
Accepted

How to get Google Account last activity info with more precision than a simple date?

Google offers a very detailed log for you to review: https://myactivity.google.com/myactivity It has a date filter and shows minute-by minute activity.
schroeder's user avatar
  • 145
2 votes
Accepted

Google Sheets casting cell value from Object to Number

Short answer How can I convert a cell value to a number? On Google Sheets durations are just a display format for date values, so when a custom function takes a duration it's treated as a date ...
Rubén - Volunteer Moderator -'s user avatar
2 votes
Accepted

Adjusted script to look for column header name, not the numeric representative of the column

If the pattern will always be the same (three columns for each customer), rather than searching for a column named status, your script could look to column C and every third column after it. C is ...
Rubén - Volunteer Moderator -'s user avatar
2 votes

How to make Google Sheets jump to closest date to today when opened?

I was able to piece together a solution thanks to the help of @Rubén who provided the elements. Perhaps there is a more elegant solution (with a single formula?), but this working for me. This ...
user196554's user avatar
2 votes

Youtube player shortcut or extension to change to next higher or lower video resolution

There might be a workaround for this. I've been using "Hot Keyboard" macro for the past couple of years to deal with such problems. It has a very neat keyboard recorder/editor and you can also set ...
dashakol's user avatar
  • 161
2 votes

How to Jump to Column Based off of Cell Value

You want a user to select a column letter from a dropdown list, and then have the spreadsheet "jump" to that column. There may be several ways to solve your question. Consider this answer as ...
Tedinoz's user avatar
  • 5,751
2 votes

Validate values before writing

Solution: Simply add rows before initializing the range. This way I can access the validation rules. const sheet = ss.getActiveSheet(); const dataRange = sheet.getDataRange(); const firstRow = ...
Julius's user avatar
  • 243
2 votes
Accepted

How to invoke the dark theme selection on Google's search page?

You're overcomplicating things for no reason. Just click on the <div> element that you mentioned, you don't have to invoke anything. You need to narrow it down with a better selector then, also. ...
Destroy666's user avatar
2 votes

Printing the date of a cell in the Google Apps Script console

To get the date in cell date!D1 as a text string in the format it shows in the spreadsheet, use Range.getDisplayValue(), like this: function getDateAsShown() { const ss = SpreadsheetApp.getActive(); ...
doubleunary's user avatar
  • 15.1k
1 vote

App Script dynamic data validation based on list

You said that you're trying to "apply Data Validation from the first table to the second table.". I'm not sure what this would have to do with Apps Script (except that you can define Data ...
Tedinoz's user avatar
  • 5,751
1 vote
Accepted

Custom Function to Cross-Joining

You can get that with a custom function, but it would probably make more sense to use a plain vanilla spreadsheet formula. The example results you show is row-by-row concatenation rather than a ...
doubleunary's user avatar
  • 15.1k
1 vote
Accepted

Automatically Merge Group of Cells Below a Text Value

Answer to the original question I've created the following function: function Merge() { var ss = SpreadsheetApp.getActiveSpreadsheet(); var s = ss.getSheetByName('Schedule'); const range = ...
bas's user avatar
  • 381
1 vote

How to set all checkboxes to FALSE in a specific column without losing formulas

Your data is in column A. The number of rows is large, but variable. If a cell in Column A contains text, the cell value should be changed to a boolean value of "FALSE". If the cell contains ...
Tedinoz's user avatar
  • 5,751
1 vote
Accepted

How do I easily change the font colour in Gmail compose?

Gmail Built-In Features Defaulf format style By changing the default format style there is no need to use userscripts or Gmail add-ons. Ref. Formatting, fonts, and colors. Click on Settings (gear ...
Rubén - Volunteer Moderator -'s user avatar
1 vote

How to Hide/Show Different Rows based on MULTIPLE cell values

The following block "doesn't work" because it's inside of the first if block if(e.range.getA1Notation() === 'B5' && e.range.getSheet().getName()=='Temp1'){ if(e.value=='Base10') { e....
Rubén - Volunteer Moderator -'s user avatar
1 vote

Friendly Team vs. Enemy attack math and complicated functions in Google Sheets

To create a custom function use Google Apps Script. This is very similar to writing a JavaScript function. /** * If the arguments are numbers, the sum of will be returned * If one of arguments are ...
Rubén - Volunteer Moderator -'s user avatar
1 vote

Working With Durations In Google Apps Script

I think we can't manipulate duration calculated. We need to convert them to numbers first, and then we can manipulate number values calculated. After that, we convert them back to duration. For ...
Albert Phan's user avatar
1 vote

Working With Durations In Google Apps Script

Google Apps Script / JavaScript doesn't include a "native" way to handle durations but you could use a library like moment.js to add several methods to handle them but this could imply a steeped ...
Rubén - Volunteer Moderator -'s user avatar
1 vote
Accepted

Google Apps Script Javascript compatibility error

UPDATE: Google Apps Script now offers two JavaScript engines Original: Based in Mozilla's Rhino JavaScript interpreter, which doesn't support several ECMAScript 5 features New: Google V8, used by ...
Rubén - Volunteer Moderator -'s user avatar
1 vote
Accepted

How to get correct TimeZone in googlesheet using script?

To pass strings as arguments to a custom functions they should be quoted enclosed. Instead of =myFunctions(A1,Aisa/Tehran,"dd-MM-yyyy'T'HH:mm:ss'Z'") use =myFunctions(A1,"Asia/Tehran","dd-MM-yyyy'...
Rubén - Volunteer Moderator -'s user avatar
1 vote

Youtube player shortcut or extension to change to next higher or lower video resolution

You can use Improve YouTube! (Chrome version / Firefox version) — an open-source browser extension that can tweak YouTube in various ways, such as setting shortcut keys / hotkeys for various YouTube ...
galacticninja's user avatar
1 vote

How do I make this Google Sheets Script faster

API calls, such as getRange and getValue are expensive, so you should minimize the number of times you get data from your sheet. But there's no apparent cost of getting a lot of data in one call. You ...
Vidar S. Ramdal's user avatar
1 vote

How to use Google Tasks on the web standalone?

I used simplegamer solution with tasks.google.com/embed link but for javascript I prefer greasemonkey, so you save 1 click every time. This is the script I use in greasemonkey: // ==UserScript== // @...
vondravl's user avatar
1 vote

The script does not have permission to get the active user's identity

The range the script tried to add notes was within a protected range. That's why it works for app owner but not shared editors. I just unprotected the range for the script and it worked. Not ideal but ...
sojim2's user avatar
  • 159
1 vote

How to format the time in this Google Apps Script

you are calling time inside date (formatDate) without actual date format so the sheet is guessing. var formattedDate = Utilities.formatDate(time, "GMT+2", "MM-dd-yyyy HH:mm:ss");
user0's user avatar
  • 26.8k

Only top scored, non community-wiki answers of a minimum length are eligible