// ----------------------------------------------------------------------
// 범위 겹침 검사
// ----------------------------------------------------------------------
function rangeIntersect(R1, R2) {
if (R1.getLastRow() < R2.getRow() ) return false;
if (R2.getLastRow() < R1.getRow() ) return false;
if (R1.getLastColumn() < R2.getColumn()) return false;
if (R2.getLastColumn() < R1.getColumn()) return false;
return true;
}
// ----------------------------------------------------------------------
// 셀이 수정되면 강제로 값 제거
// ----------------------------------------------------------------------
function autoDeleteCellValue(sheet, eventRange, sheetId, targetRangeA1) {
// if(sheet.getName() !== sheetName) return;
if(sheet.getSheetId() !== sheetId) return;
var WHITE = "#ffffff";
var BLACK = "#000000";
var targetRange = sheet.getRange(targetRangeA1);
if(rangeIntersect(targetRange, eventRange)) {
// 여러 셀을 동시에 수정한 경우, 무시
// if(eventRange.getNumRows() * eventRange.getNumColumns() > 1)
// return;
eventRange.setValue("");
}
}
// ----------------------------------------------------------------------
// Event
// ----------------------------------------------------------------------
function onEdit(event) {
var sheet = SpreadsheetApp.getActiveSheet();
var eventRange = event.range;
autoDeleteCellValue(sheet, eventRange, 1623326516, 'V4:V1000');
}