0

Is it possible to copy the values of a named range in one sheet and paste them in the same cell location of another sheet?

For example, I have named range "old_desk_1" in sheet1!A24:A25 and named range "desk_1" in sheet2!A24:A25. Is it possible to copy the values in the cells of old_desk_1 to desk_1 without just doing the standard copy/paste?

Mogsdad
  • 44,709
  • 21
  • 151
  • 275
user1916075
  • 91
  • 2
  • 4
  • 9

1 Answers1

0

Yes it is, first I suggest looking at the following documentations.

The above links will tell you about all the methods available for all the classes you will need to do this. Here is a basic example of what you're hoping to acheive.

function copyCells(){
   var thisSpreadsheet = SpreadsheetApp.getActiveSpreadsheet();
   var theRange = thisSpreadsheet.getRangeByName("YOUR RANGE");

   var destinationSheet = thisSpreadsheet.getSheetByName("SHEET TO COPY TO");
   var destinationRange = destinationSheet.getRangeByName("YOUR OTHER RANGE");

   theRange.copyTo(destinationRange);
}
dev
  • 3,969
  • 3
  • 24
  • 36