Hey I can't seem to be able to write this script sucssefully.
I want that when I press a button a certain percentage value will be added to an entire column. https://docs.google.com/spreadsheets/d/1KLvgW0HBZg0spWp8osskl1LgR3sslxScI4E9w1OBKfg/edit?usp=sharing Link to the sheet itself.
what i want is to add the value in K2 to the entire B column by clicking the button on L2
Here is the code I tried to do:
function increase(){
ModifyCell("B2:B","L2","I1")
}
function ModifyCell(CellName, increase,precentage) {
var s = SpreadsheetApp.getActiveSheet();
var r = s.getActiveCell();
if( r.getColumn() == 2 && r.getValue()>0)
var nextCell = r.offset(0, 1);
nextCell.setValue(r.getValue()+r.getValue()*increase-r.getValue() *increase*precentage);
}