Skip to content

Instantly share code, notes, and snippets.

@oshliaer
Last active August 29, 2015 14:23
Show Gist options
  • Select an option

  • Save oshliaer/d2079f4e0a8872386335 to your computer and use it in GitHub Desktop.

Select an option

Save oshliaer/d2079f4e0a8872386335 to your computer and use it in GitHub Desktop.

###Copy Google Spreadsheet Values

var settings = [
{
from: '1TdiT4vPOiSenwCNTvE3cQTKUC7w-NFKSZ0mo2F5n7Lo',
to: '1TdiT4vPOiSenwCNTvE3cQTKUC7w-NFKSZ0mo2F5n7Lo',
fromRange: 'ЛистА!A1:C10',
toRange: 'ЛистБ!A1:C10',
},{
from: '1TdiT4vPOiSenwCNTvE3cQTKUC7w-NFKSZ0mo2F5n7Lo',
to: '1TdiT4vPOiSenwCNTvE3cQTKUC7w-NFKSZ0mo2F5n7Lo',
fromRange: 'ЛистА!A12:C13',
toRange: 'ЛистБ!A12:C13',
}
];
function copyRange() {
for(var i in settings){
var values = SpreadsheetApp.openById(settings[i].from).getRange(settings[i].fromRange).getValues();
SpreadsheetApp.openById(settings[i].to).getRange(settings[i].toRange).setValues(values);
SpreadsheetApp.flush();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment