So I have this script:
function copyThis() {
const sheetName1 = 'A'
const sheetName2 = 'B'
sheet1 = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(sheetName1)
values = sheet1.getRange('BJ8').getValues()
sheet2 = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(sheetName2)
sheet2.getRange('B12').setValues(values)
}
The result is #ERROR! in cell B12 in sheet B. Please help.
Note: Cell BJ8 contains a formula. I want to copy its value to B12 which already contains a value.
I was expecting it to get the value (a number) in cell BJ8 from sheet A and paste it into cell B12 in sheet B.