Search code examples
google-apps-scriptgoogle-sheetsformatrangeplaintext

Set format as plain text


function A1format() {
 var ss = SpreadsheetApp.getActiveSpreadsheet();
 var mainsheet = ss.getSheetByName("Sheet1");
 var G = mainsheet.getRange("C15:BH3000").getGridId();
 var illa = mainsheet.getRange("A13");

 Logger.log(G);
 illa.copyFormatToRange(G, 16, 3,200, 30);
 }

This doesnt Work and gives some strange Server error. Please help


Solution

  • ldo Green answer above is right : in your code the end row is smaller than the start row...(columns are wrong too but it strangely accept this small negative difference) this is indeed not valid.

    Using the autocomplete feature in the editor will remind you the parameters as follows :

    enter image description here