[英]Using Python (and DataNitro) to copy cells from a particular sheet in one Excel workbook, to a particular sheet in another Excel workbook
I do a lot of data analysis in Excel and have been exploring Python and DataNitro to streamline my workflow. 我在Excel中进行了大量的数据分析,并一直在探索Python和DataNitro来简化我的工作流程。 I specifically am trying to copy certain cells from one sheet in one Excel workbook, and paste them into certain cells in a certain sheet in another Excel workbook.
我特别试图在一个Excel工作簿中复制一个工作表中的某些单元格,并将它们粘贴到另一个Excel工作簿中的某个工作表中的某些单元格中。 I have been storing ("copying") using CellRange (DataNitro), but am not sure how to copy the stored contents into a particular sheet, in another Excel workbook.
我一直在使用CellRange(DataNitro)存储(“复制”),但不知道如何将存储的内容复制到另一个Excel工作簿中的特定工作表中。 Any clue how I may go about this?
我有什么想法可以解决这个问题吗? Also, is it possible to make the range defined for a CellRange conditional on certain cell properties?
此外,是否可以使CellRange的定义范围以某些单元格属性为条件?
I would really appreciate any help! 我真的很感激任何帮助! Thank you, all.
谢谢你们。
Here's an example of copying: 这是一个复制的例子:
data = CellRange("A1:A10").value
active_wkbk("Book2.xlsx")
CellRange("A1:A10").value = data
You can make the range conditional using regular Python logic ( if
statements, etc.). 您可以使用常规Python逻辑(
if
语句等)使范围成为条件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.