google-sheets

Fill a cell with timestamp of another cell edit ONLY if another cell is not blank

限于喜欢 提交于 2021-01-29 16:28:21
问题 I need fill a cell in google spreedsheet with the timestamp of the another cell's edition. But this timestamp should be show only if the another cell is edited with some content, not with erase the cell. I have been try with this code, but the timestamp is shown also if i erase the another cell. function onEdit(e) { if ([8].indexOf(e.range.columnStart) != -1) { if ([8].indexOf(e.range.columnStart) === '') { e.range.offset(0, -7).setValue('0'); } else e.range.offset(0, -7).setValue(new Date())

How to reference a cell as the file or folder id for DriveApp?

我与影子孤独终老i 提交于 2021-01-29 15:36:37
问题 I have an app script function that includes IDs for both a doc file tmplate and a Google Drive folder location. I want the ID to be dynamic based on a users input via a cell reference in a Google Sheet. Is it possible to call this value using a cell reference? Example: Settings!B9 = Google Doc Template ID //This value should be the id of your document template that we created in the last step const googleDocTemplate = DriveApp.getFileById('INSERT CELL REFERENCE'); //This value should be the

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 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

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):

Value tallying code dysfunctions when put into discord command

删除回忆录丶 提交于 2021-01-29 13:51:01
问题 I just coded my bot and basically it sums every user's daily guild XP from the last seven days and prints it in a list into a google sheet. There is one problem and it is that the guild XP values in the list are wrong when manually adding up, which is the guild XP from all seven days from the API JSON. The names it prints are right, but the values are wrong, and I can't tell exactly how they are. This only happens when the code below is run in a discord command, but the code functions

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