I have the following script which is doing exactly what I want (changing the currency symbol within cells depending on what is selected), except that it’s being applied to all cells, and I’d like it applied only to cells C9, C12, C13. I’m probably missing something painfully obvious, but I’m just not quite sure where I would put that in the script. Thank you!
function udtsymbol () {
const s = SpreadsheetApp.getActiveSheet();
const r = s.getDataRange();
const symb = {"$":"$", "€":"€", "£":"£"};
r.setNumberFormat(symb[s.getRange("C8").getValue()]+"###,##0.00");
I’ve tried editing the code in a number of different ways, including adding the range within getDataRange() and also putting in an if statement, but I keep getting errors, as I’m not familiar with javascript. Have been googling for hours so finally asking for help.