I must confess I'm new to apps script code.
I'm trying to make a function with two arguments, to give it two cells, and make it copy the value of the first cell into the second cell. The idea is to be able to use the function as a shortcut to make this operation again (and with maths sometimes) with many others.
I've made this, and tried a few variations.
function copy(case1, case2) {
var sheet = SpreadsheetApp.getActiveSheet();
var c1 = parseInt(sheet.getRange(case1).getValue());
sheet.getRange(case2).setValue(c1);
}
copy('K4', 'M4');
Wich results with "Exception: Argument cannot be null: a1Notation", copy @ Code.gs:3 (the line with var c1).
I'm probably not using it the good way. I did not find any subject speaking about this, but If I missed one please let me know. I thank you for any help you'll provide.