Reputation: 3325
The code:
function CopyPasteA6() {
var sheet1 = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Sheet1');
var sheet2 = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Sheet2');
sheet1.getRange('A6').copyTo(sheet2.getRange('A6'))
}
This will copy the entire cell, including the formula. If I just want to copy the cell value and leave out if there is any formula, is that possible?
Upvotes: 0
Views: 2404
Reputation: 46794
function CopyPasteA6() {
var sheet1 = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Sheet1');
var sheet2 = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Sheet2');
sheet2.getRange('A6').setValue(sheet1.getRange('A6').getValue());
}
Upvotes: 1