google-apps-script

Google Spreadsheet Hide and unhide rows based on cell values

谁都会走 提交于 2021-01-29 15:24:01
问题 I have a spreadsheet with date's (Months) I'm looking for a script that hides and unhide's rows automatically. In column "Z" is a formula (=IF(A3=TODAY();"";"1")) So the cells containing "1" has to hide the row and the empty cells should unhide the row. Can anyone help me? I have seen a lot of forums with no result for me :( See the example below! Example 回答1: function hideShow() { var ss=SpreadsheetApp.getActive(); var sh=ss.getActiveSheet(); var rg=sh.getRange(3,26,sh.getLastRow()-2,1); var

Google Script has two triggers for on edit. Can I remove the “simple” one?

限于喜欢 提交于 2021-01-29 15:09:49
问题 I have a Spreadsheet script with an onEdit trigger. For some reason two onEdit triggers are "fired": an installed trigger and a simple trigger. I set up onEdit to send an email. This was authenticated for the installed trigger and works fine. However, each time it fires the simple trigger it throws an exception. Is it possible to remove or disable the simple trigger so that it doesn't throw the exception? I wrote a simple function to check what triggers my script was using. It only shows one

Google Script For “Marking” Non Blank Rows

白昼怎懂夜的黑 提交于 2021-01-29 14:25:30
问题 I'm trying to create a google script that will look at my sheet, get the length of data and then mark "processed" in Column P. I can't do this with an array/if formula because I need to know when a new line comes in and has not been processed. My current script just writes never ending data to column P. I want it to only write to the last non blank row based on Column A. Here is my example sheet and script that isn't working. https://docs.google.com/spreadsheets/d

Make a simple counter in Google Scripts which keeps track of previous value

一个人想着一个人 提交于 2021-01-29 14:23:47
问题 so I'm trying to make an auto-rotating schedule using google sheets and a custom function which selects a new employee from a linked sheet each week and then starts again at the top of the list when it gets to the bottom, using a Google trigger to run the counter every 7 days. I'm having a hard time figuring out how to store a value in the spreadsheet each week to store the counter's value and then refer to that same value when the function runs again to update the counter. I'm also having an

In Google Sheets, how do you change the sheet that the user sees?

|▌冷眼眸甩不掉的悲伤 提交于 2021-01-29 14:23:17
问题 I have a Google Sheet spreadsheet with some javascript code in it. The user(s) begin on a default sheet and the code creates and names a sheet based on the user that is accessing it. There is a bunch of code that copies data to their sheet, formats it, resize columns, etc. That all works fine. All I want to do is have the focus the user sees change from the default entry sheet to the custom sheet that was created for the user. I've tried using: sheet.activate() sheet.setCurrentCell(cell) ss

Why can't I import a Library in Google Scripts editor?

馋奶兔 提交于 2021-01-29 14:20:05
问题 I've recently created a Google Scripts new Project, called Database. Then, I've used a saved version (version 4) of that script in another project and afterwards dropped (by accident) that version of Database. Now, even if a create a new version, when I open in the menu Resources > Libraries of nthe new project, the Database project appears with the version 4. screen When I try to change it and save, the following error appears: A biblioteca com o identificador Database está ausente. Talvez

Is there some approaches that will log information in the last row for specific columns?

谁说胖子不能爱 提交于 2021-01-29 14:12:59
问题 In google sheets, I tried to log some information I entered in other sheet to my invoiceLogSheet. but the problem is : when the information log to the sheet, it always log in the last row for entire sheet, and what I want is : to log in last row for specific range of columns (clarify more: to check in specific columns their free last row and log the information on this row) but I don't know how to script this .. this is the function I used and it does not do the job I want: function

Script to refresh data with IMPORTHTML in Google Sheets

£可爱£侵袭症+ 提交于 2021-01-29 13:59:06
问题 I'm trying to get the data about XAU prices from table here: https://www.investing.com/currencies/xau-pln-historical-data I need to have the data in google sheets and the problem is that it doesn't refresh the data. When I clean cells manually and insert formula then data is refreshed, but when I do it using script it doesn't work. I have this script (based on https://support.geckoboard.com/hc/en-us/articles/206260188-Use-Google-Sheets-ImportHTML-function-to-display-data-in-Geckoboard):

Get the row/col of a clicked drawing?

北战南征 提交于 2021-01-29 13:49:55
问题 I assign to a cell in each row a png icon and a script with sheet.insertImage(blob, 11, i).assignScript("ClickMe"); At the end of the process I have a few hundred rows with buttons at the end. What I'm struggling to do at the moment is work out which row gets clicked on. I've tried a few likely candidates like var ss = SpreadsheetApp.getActiveSheet(); var sheetName = ss.getSheetName(); var activeRange = ss.getActiveRange(); var selection = ss.getSelection(); var ar = activeRange.getA1Notation

Only get non-filtered values for Google App Script getRange using isRowHiddenByFilter or isRowHiddenByUser

别等时光非礼了梦想. 提交于 2021-01-29 13:47:12
问题 I'm fairly new, trying to do the same thing as Only get non-filtered values for Google App Script getRange - get all rows that aren't hidden without using an added column. Make it generic so that regardless of what fields were used to hide rows, I'll only be acting on the non-hidden. I've been playing with isRowHiddenByFilter() and isRowHiddenByUser() but not getting it. To get all unfiltered rows, would I need to check that isRowHiddenByFilter() and isRowHiddenByUser() are both false? It