简化如下代码: myNewSheet = myNewBook.active myNewSheet.append(myRange[0]) myNewSheet.append(myRange[1]) myNewSheet.append(myRange[2])
时间: 2023-06-20 21:06:26 浏览: 58
py代码-测试append和+=.py
可以简化为:
```
myNewSheet = myNewBook.active
for row in myRange:
myNewSheet.append(row)
```
或者使用列表解析:
```
myNewSheet = myNewBook.active
[myNewSheet.append(row) for row in myRange]
```
阅读全文