简体   繁体   English

将范围从一个工作表复制到Google工作表中的另一个工作表

[英]Copy a range from one sheet to another in google sheet

I ave been trying to copy a range from one google sheet to another without success. 我一直试图将一个Google工作表的范围复制到另一个Google工作表而没有成功。 I have tried all the answers that I have come accross but they were al fruitless for me. 我已经尝试了所有遇到的答案,但对我来说这些都是徒劳的。 Everything in the script work apart from the content or ell does not get copied. 脚本中的所有内容与内容无关,否则不会被复制。

Any help or guidance will be very much appreciated. 任何帮助或指导将不胜感激。 Here is the code that I am using: 这是我正在使用的代码:

function copyCell() {



var ss = SpreadsheetApp.getActiveSpreadsheet();

  var source = ss.getSheetByName("City");

  var destination = ss.getSheetByName("Boost");


  var source_range = source.getRange("A17").getValue(); 

  ss.setActiveSheet(ss.getSheets()[2]);

  destination.insertRowAfter("3");

  var destination_range = destination.getRange("A4")

  destination_range.setValue(source_range);

  Browser.msgBox("The value has been added",Browser.Buttons.OK)

}

My friend I created this script and works fine for me 我的朋友我创建了这个脚本,对我来说很好用

Function copyCell (sourceWorksheet, sourceSpreadsheet, rangeToCopy, destSpreadsheet, destRow, destColumn) {
 var source = SpreadsheetApp.openById(sourceWorksheet);
 var sourceSheet = source.getSheetByName(sourceSpreadsheet);
 var destSheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(destSpreadsheet);

var rangoToCopy = sourceSheet.getRange(rangeToCopy).getValue;

destSheet.getRange(destRow,destColumn).setValue(rangoToCopy)}

暂无
暂无

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

相关问题 Google Spreadsheets 脚本 - 如何将范围从一张纸复制到另一张纸,但不覆盖非空目标单元格 - Google Spreadsheets script - How to copy range from one sheet to another sheet, but without overwriting non-empty target cells 进行编辑后,如何将范围从一个Google表格复制到另一个表格? - How do I copy a range from one Google Sheet to another when edits are made? 如何将范围从一个工作表复制到另一工作表的范围,然后重复复制到下一行 - How to copy a range from one sheet to a range in another sheet, then repeat copying to the next row down 将特定范围复制到从一个工作表到另一个工作表中的第一个空行和特定列 - Copy a specific range to from one sheet to the first empty row and specific column in another sheet Google电子表格将值从一行复制到另一张工作表 - Google spreadsheet copy values from one row to another sheet 根据条件将单元格值从一个Google工作表复制到另一个 - Copy cell values from one google sheet to another based on condition 将数据从一张纸复制到另一张 - Google Script - Copy Data from one sheet to another - Google Script 将一行从一个Google表格电子表格复制到表单提交中的另一表格 - Copy a row from one Google Sheet Spreadsheet to Another on Form Submit Google 工作表脚本将数据集从一张工作表复制到另一张工作表的顶部(仅限值) - Google sheets script copy data sets from one sheet to another (values only) at the top of the sheet Google 工作表应用程序脚本 - 根据循环条件将数据从一张工作表复制到另一张工作表 - Google sheet app script - Copy data from one sheet to another based on condition with loop
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM