Newbie here asking dumb questions. Trying to teach myself GAS. I picked up this formula from the forum somewhere. It is deliberately simple just to get it working properly. The function works BUT ONLY for the first instance of the strToFind. My attempts to fix this have just made a mess of it. I admit to not fully knowing what I'm doing. Hopefully somebody can help.
function changeFormula()
{
var strToFind = "May 16";
var strToReplace = "Jun 16";
var range = SpreadsheetApp.getActiveSheet().getActiveRange();
var formulae = range.getFormulas();
var ui = SpreadsheetApp.getUi();
ui.alert('Got here');
for (var i = 0; i < formulae.length; i++)
{
for (var j = 0; j < formulae[0].length; j++)
{
if (formulae[i][j].indexOf(strToFind) > -1)
{
formulae[i][j] = formulae[i][j].replace(strToFind, strToReplace);
}
}
}
range.setFormulas(formulae);
}