I'm getting started on using script with Google Tables. To start I wanted to write a simple copy script which takes the values from column A and copy's it to the next free column. My problem right now is that the copyTo function doesn't work with numerical values, but the whole use next free column doesn't work with B1 Ranges or sth similar. My second thought was using a function which converts numerical range to a "normal" range, sth like convertToRange(2,1) which would return B1. But I couldn't find anything similar again.
Can anyone help me out here?
function copy () {
var ss = SpreadsheetApp.getActiveSpreadsheet ();
var source = ss.getRange ("A2:A10");
var destColumn = ss.getLastColumn();
source.copyTo(destColumn,1)
source.clear ();
}