Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * CONFIGURATION SECTION :=============================================================================
- * Edit the variables here to match the information in your sheet
- */
- INPUT_SHEET = "INPUT";
- OUTPUT_SHEET = "OUTPUT";
- DATE_TO_MATCH = "1-Jan-2022";
- /**
- * END OF CONFIGURATION SECTION :======================================================================
- * Do not edit the code under this point
- */
- /**
- * It gets the values from the input sheet, and then compares them to the date to match. If the date
- * matches, it clears the content.
- */
- function deleteCell() {
- const ss = SpreadsheetApp.getActiveSpreadsheet();
- const sheet1 = ss.getSheetByName(INPUT_SHEET);
- const sheet2 = ss.getSheetByName(OUTPUT_SHEET);
- let inputValue = sheet1.getRange("H4:H15").getValues();
- const outputValue = sheet2.getRange("H4:H100").getValues();
- const dateToMatch = new Date(DATE_TO_MATCH).toDateString();
- inputValue.forEach((value) => {
- value = new Date(value).toDateString();
- if (value === dateToMatch) {
- value.clearContent;
- }
- });
- debugger;
- }
Advertisement
Add Comment
Please, Sign In to add comment