Search code examples
google-sheetsgoogle-apps-scriptgoogle-sheets-formula

popup on cell edit - Google Sheet


I need help on pop up msg anytime a cell is edited in column F,H and L

basically i want my team to only add whatsapp numbers. so msg should convey and ask them to follow that.

like "add whatapp number only"


Solution

  • You can try this simple trigger function:

    function onEdit(e) {
      const column = e.range.getColumn(); 
      // Check if the edit is in column F (6), H (8), or L (12)
      if ([6, 8, 12].includes(column)) {
        // Show a message box with the instruction
        SpreadsheetApp.getUi().alert("Please add WhatsApp numbers only.");
      }
    }