
But an actual example of your workbook (devoid of any confidential or personal information) would be most helpful. Get the number of columns in the active sheet. If the answers to 1 and 2 are both 'Yes,' then it should be fairly easy to write a formula or two that would retrieve the information from each new sheet and populate the master sheet with the data.

Get the row and column of the active cell. to let you modify where the action and move columns are in the form responses sheet * Moves row of data to another spreadsheet based on criteria in column 6 to sheet with same name as the value in column 4. Filter actually returns an array of values. Filter is also the best equivalent to XLOOKUP in Google Sheets.

The filter () formula is one of those things that makes Google Sheets special: it makes it really easy to think in arrays. Only available if the edited range is a single cell Method one of doing XLOOKUP in Google Sheets: FILTER. For example: FieldĪ Spreadsheet object, representing the Google Sheets file to which the script is boundĪ Range object, representing the cell or range of cells that were edited
#New tab for google sheet code#
Looking through Victor’s code I was surprised he didn’t use the onEdit fields available. Perhaps there is conflict between the onSubmit and onEdit events. To use ‘copy’ instead in Victor’s code you would replace moveTo with: s.getRange(rowIndex, 1, 1, colNumber).copyTo(target) Īnd add the line afterwards of s.deleteRow(rowIndex) In particular it looks like new Sheets “Cannot cut from form data. The route of the problem appeared to be not only has Google Apps Script changed a lot since then but so has Google Sheets and Forms. If yes then the data is moved to an appropriate sheet within the spreadsheet. Someone then looks at the data entered and decides if it should be actioned. The idea is a Google Form is used to collect data into a Google Sheet. s.deleteRow (rowIndex) which will delete the row just changed. Use copy instead.: To use ‘copy’ instead in Victor’s code you would replace moveTo with: s.getRange (rowIndex, 1, 1, colNumber).copyTo (target) and add the line afterwards of. The person was reusing some code posted by Victor Yee back in 2012 which hooks into the onEdit event in Google Sheets. In particular it looks like new Sheets Cannot cut from form data. There was a question that came up in the Google Apps Script G+ community about moving a row of data to another sheet.
