I’m generating repetative Google app scripts through formulas in Google Sheets.
When I paste the script generated below:
function testIns2(e){
//Completed
var range1 = SpreadsheetApp.getActiveSpreadsheet().getRange(“B4”)
range1.clearContent()
var value1 = range1.getValue()
value1 = value1 + SpreadsheetApp.getActiveSpreadsheet().getSheetByName(‘AdvancedButtons’).getRange(“C3”).getValue()
range1.setValue(value1)
}
The ” ” doubles
//Completed
var range1 = SpreadsheetApp.getActiveSpreadsheet().getRange(“”B4″”)
range1.clearContent()
var value1 = range1.getValue()
value1 = value1 + SpreadsheetApp.getActiveSpreadsheet().getSheetByName(‘AdvancedButtons’).getRange(“”C3″”).getValue()
range1.setValue(value1)
The same thing happend just now when I pasted into stackoverflow.
To get the quotes to work in Google Sheets in the formula generating the script I use:
getRange(“&Char(34)&A1&Char(34)&”) This displays as:
.getRange(“C3”).getValue()
But pasted into Google App Scripts I get a “”C3″”
Any recommendations on how to prevent double quotes?
Thanks!
Eoin
I tried using char(34) for the ” and I tried using a /”/ to display the quotes as in a regex function