I've created a spreadsheet then added some values. I opened the script editor through the menu and added an onEdit function. I cannot, for the life of me, get that script to do anything when I edit a cell in the sheet.
It will run if I specifically press the "run" button in the editor, but that sort of defeats the purpose. What am I missing?
in case it matters here is my code
function onBugEdit() {
Browser.msgBox("test");
var sheet = SpreadsheetApp.getActiveSheet();
var rng = sheet.getActiveRange();
var val = rng.getValues();
var col = rng.getColumn();
var row = rng.getRow();
var h_string = '=HYPERLINK("http://example.com?id='+val+'","'+val+'")';
if(col == 4) {
col = "D";
cell = sheet.getRange(col+row);
cell.setFormula(h_string);
}
};
The project trigger is set for the onEdit function but again nothing happens when I edit a cell.