Preview:
function onEdit(e) {
  if (!e) return;

  var sheet = e.source.getActiveSheet();
  var range = e.range;
  var editedValue = e.value;
  var previousValue = e.oldValue;

  // Define the start columns and start rows for each sheet
  var config = {
    "Pengajuan Konten": { columns: [5, 6, 19, 23, 28], startRow: 3 },
    "Timeline Wilayah": { columns: [8, 9], startRow: 2 },
    "Akun Media Partnership": { startColumn: 7, startRow: 5 }
    // Add more sheets and their configurations here
  };

  var sheetName = sheet.getName();
  if (!config[sheetName]) return; // Exit if the sheet is not configured

  var sheetConfig = config[sheetName];
  var startColumns = sheetConfig.columns || [sheetConfig.startColumn];
  var startRow = sheetConfig.startRow;

  if (startColumns.indexOf(range.getColumn()) !== -1 && range.getRow() >= startRow) {
    if (previousValue == null || previousValue === "") {
      range.setValue(editedValue);
    } else {
      var previousValues = previousValue.split(', ');

      var index = previousValues.indexOf(editedValue);

      if (index === -1) {
        previousValues.push(editedValue);
      } else {
        previousValues.splice(index, 1);
      }

      range.setValue(previousValues.join(', '));
    }
  }
}
downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter