function onEdit(e) { const watchName = "Temp Cost Information"; // Please set the sheet name for the sheet where data will change. const updateName = "Temp WFP"; // Please set the sheet name for the sheet where the filter needs to update. //Constrain onEdit to only watch the sheet we manually update. const watchRange = e.range; const watchSheet = watchRange.getSheet(); if (watchSheet.getSheetName() != watchName) return; //Reapply current filter on sheet we want auto-updated. const updateSheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(updateName); const filter = updateSheet.getFilter(); const fRange = filter.getRange(); const criterion = filter.getColumnFilterCriteria(4).copy(); filter.remove(); fRange.createFilter().setColumnFilterCriteria(4, criterion); }