google-sheets-macros

Overwriting Google sheets (for form response) rows if duplicate entered

不打扰是莪最后的温柔 提交于 2020-04-17 04:33:28
问题 So, I've been trying to figure out how to stop the duplicate rows appearing in my google sheets response output from a google form. If found this link which sounds like it does exactly what I want (Form Google Script Prevent Duplicates), but cannot for the life of me work out how to edit the given answer to work on my sheet. I have included a screenshot of my workbook to give an example of the structure of the data I'd like the edited code to run on, and also below is my attempt at making the

Overwriting Google sheets (for form response) rows if duplicate entered

限于喜欢 提交于 2020-04-17 04:32:21
问题 So, I've been trying to figure out how to stop the duplicate rows appearing in my google sheets response output from a google form. If found this link which sounds like it does exactly what I want (Form Google Script Prevent Duplicates), but cannot for the life of me work out how to edit the given answer to work on my sheet. I have included a screenshot of my workbook to give an example of the structure of the data I'd like the edited code to run on, and also below is my attempt at making the

How can I get a macro to automatically trigger when a cell reaches a certain value in a Google Sheet?

▼魔方 西西 提交于 2020-04-16 09:15:10
问题 What I need is for a macro I've recorded called SwitchHotSeat to trigger when the value of cell F3 goes above £1,000,000.00 0r 1000000 or the LEN of cell F3 goes over that length. I can find guides for doing this in Excel, but not for Google Sheets. below is just the code for my macro. function SwitchHotSeat() { var spreadsheet = SpreadsheetApp.getActive(); spreadsheet.getRange('3:3').activate(); spreadsheet.getActiveSheet().deleteRows(spreadsheet.getActiveRange().getRow(), spreadsheet

How to update the data range of an existing graph using app script? [Google Sheets]

这一生的挚爱 提交于 2020-02-25 05:18:25
问题 I have created the script below, which runs from an onedit function for when cell J1 is edited. The graph exists in the sheet titled 'Daily Data'. The data it will be using is from a sheet titled 'Long Term Data'. I used the following link as guidance: https://developers.google.com/apps-script/reference/spreadsheet/embedded-chart. Thank you for any help. function onEdit(e) { //This IF statement ensures it will only run when cell J1 is edited: if ( e.source.getSheetName() == "Daily Data" && e

How to loop getRange(“B” + row + “ :” + “J” + row) in google sheet editor script

爷,独闯天下 提交于 2020-01-26 04:55:25
问题 function onEdit(evt) { var range = evt.range; showAutoValue(range); } function showAutoValue(range){ var spreadSheet = SpreadsheetApp.getActiveSpreadsheet(); var activeSheet = spreadSheet.getActiveSheet(); var row = range.getRow(); var column = range.getColumn(); if(column == 1 && row >= 1){ var Avalue = activeSheet.getRange("A" + row).getValue(); var B_Jrange = activeSheet.getRange("B" + row + ":" + "J" + row); if(String(Avalue).trim()){ for(var i = 0; i < B_Jrange.length; i++){ if(String(B

Importing XLSX file from the monthly e-mail (in Gmail) to the designated Google Sheet

会有一股神秘感。 提交于 2019-12-31 04:22:18
问题 I receive an XLSX file from our client on regular basis, and I would like to automate the process of importing it from Gmail (it's automatically labeled) into Google Sheets. So far I managed to make it work for CSV files, but XLSX files seem to be trickier. Can someone help to adjust this code I have for CSV files? function getCSV() { var thread = GmailApp.getUserLabelByName(‘Reconciliation’).getThreads(0,1); var messages = thread[0].getMessages(); var len = messages.length; var message

How to sum up the values in each column and ranking each column name by sum of values in google sheet

风流意气都作罢 提交于 2019-12-13 09:06:29
问题 I have a google sheet with values that is getting populated A B C D E F G H Top scorers Date Player l Player 2 Player 3 Player 4 13 Jan 2019 1 1 1 20 Jan 2019 2 1 1 the idea is: each match day I will enter the date of the match and number of goals that each player scored, if new player score I will just put his name in new column and number of goal on that date. If any player not score that day, I will just leave that cell blank. Then I want to populate first column "Top scorers" with ranking

Send cell data from one Google sheet to another and then overwrite data

僤鯓⒐⒋嵵緔 提交于 2019-12-13 04:27:40
问题 I have a Google sheet (Employee Timesheet) that documents employees' hours each day for the week. Once that week has finished (Monday - Friday) the data gets the overwritten with next weeks data. I need the data to be sent to another Google Sheet (Employee Data) where it will be stored. How can I send that data for it then to be documented and not removed once overwritten the following week? 回答1: you will need something like this: function tc() { var reference = 'sheet1!A2'; var rng =

How can i automatically generate rows with row grouping?

断了今生、忘了曾经 提交于 2019-12-13 03:48:47
问题 I am working on an error log template to automate error count calculations. The template has lessons for which the errors are logged. But, the number of lessons and topics can vary as per the course. So, I want to give users the option to enter the number of lessons and the sheet automatically populates with the template. Also, the sheet automatically calculates the error count for each lesson. Link to the sheet: https://docs.google.com/spreadsheets/d/1vTMT2W-G9mpdvJcTatksp9OQeZ-kAmN

Append rows from other tabs without losing formatting

我与影子孤独终老i 提交于 2019-12-11 15:45:22
问题 In an effort to organize a set of bank account and credit card statements, I download them. Then I open them in Excel or Google Sheets, reorganize them in matching columns, put all in one tab (TOTAL), and then sort. The question is now how I do the copy from the individual sheets. I think I'm pretty close after pasting and repeating (the manual way) some function I found by searching. The problem is that this function removes all formatting from the source rows Example sheet The last tab