Clear Cell Contents with Google Apps Script
4.6 هزار بار بازدید -
2 سال پیش
-
Learn how to use Google
Learn how to use Google Apps Script within Google Sheets to clear the contents of a cell when another cell is edited. This video relates to the Dependent Dropdown Chips, so if you haven't seen this, you can check it out here: • Dependent Drop-down Chips in Google S...
Google Apps Script used in this demo:
function onEdit(e) {
// Extract relevant data from the event object
var range = e.range;
var sheet = range.getSheet();
// Check if the edit is on the correct sheet and row
if (sheet.getName() === 'Sheet1' && range.getRow() === 2) {
if (range.getColumn() === 2) {
// Clear cells C2:D2 if column B (2) is edited
sheet.getRange('C2:D2').clearContent();
} else if (range.getColumn() === 3) {
// Clear cell D2 if column C (3) is edited
sheet.getRange('D2').clearContent();
}
}
}
For more videos and/or to subscribe, check out this link
youtube.com/@spreadsheetwise
Chapters
00:33 - Apps Script
02:36 - Script Permissions
03:30 - Run Script using the Sheet
03:52 - Final Script
Social Channels
twitter.com/SpreadsheetW
www.instagram.com/spreadsheetwise/
www.facebook.com/spreadsheetwise/
www.pinterest.co.uk/SpreadsheetWise/
#googleappsscript #appsscript #GoogleSheetsDropdownChips #Dropdown #dropdownmenu #dropdownlist #dependance #dependantdropdown #Spreadsheet #GoogleSheetsTipsAndTricks #GoogleSheetsHacks #googlesheets #googlesheetstutorial #Spreadsheetwise
2 سال پیش
در تاریخ 1401/10/24 منتشر شده
است.
4,618
بـار بازدید شده