我试图使用DataNitro连接Excel2010中的两列,但是每当我尝试运行此命令时,
CellRange("C1:C5").value = CellRange("A1:A5").value + CellRange("B1:B5").value我在DataNitro Python中得到了这个错误-- "CellRange设置为长度错误的对象“。
我试图将A和B列中的值连接到C列中。
发布于 2014-03-20 04:02:12
CellRange("A1:A5").value + CellRange("B1:B5").value将两个长度为5的列表相加在一起,给出长度为10的列表。若要连接列表中的元素,请执行以下操作:
CellRange("C1:C5").value = [x + y for x, y in zip(CellRange("A1:A5").value, CellRange("B1:B5").value)]https://stackoverflow.com/questions/22522833
复制相似问题