简体   繁体   English

将一个工作表中命名范围的单元格值复制到另一工作表中另一个命名范围的相同单元格地址

[英]copy cell values of named range in one sheet to same cell address of another named range in another sheet

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 . 例如,我有一个名为范围"old_desk_1"sheet1!A24:A25并命名范围"desk_1"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? 是否可以仅执行标准的复制/粘贴old_desk_1desk_1单元格中的值复制到desk_1

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);
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 从范围复制单元格值并将其粘贴到另一个工作表的单行中 - To copy Cell values from a range and paste it in a single row of another sheet 以编程方式测试 Google Sheet 单元格是否在命名范围内 - Programmatically test if a Google Sheet cell is in a named range Google Script:将值从一张纸复制到另一张纸以确定范围 - Google Script: copy values from one sheet to another determining the range 根据条件将单元格值从一个Google工作表复制到另一个 - Copy cell values from one google sheet to another based on condition 如何将一个范围复制到另一张纸的末尾 - How to copy one range to end of another sheet 将范围从一个工作表复制到Google工作表中的另一个工作表 - Copy a range from one sheet to another in google sheet Google文件-指令码,将储存格从一张工作表复制到另一张工作表 - Google Docs - Scripts, copy cell from one sheet to another sheet 将单元格范围复制到另一个工作表 - Copy range of cells to another sheet 如何将范围从母版表复制到另一张表的最后一行(另一张表名称= Mastersheet Z1中的单元格值) - How to copy a range from a mastersheet to the last row of another sheet (Another sheet name = cell value in Mastersheet Z1) 复制单元格中的值并将值粘贴到同一工作表中的另一个单元格 - Copy values from cell and paste the values onto another cell in the same sheet
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM