工作中遇到的,本来用VBA写的,操作很慢,尝试用Python实现, 任务需求: 从原始的两张表中拷贝行到五张表中,如下表所示: source1和source2是一样的格式: one two three four five 1 2 3 11 11 22 22 33 33 44 44 55 55 目标表格有one,two,three,four,five. 将前三列和对应表的两列拷贝到目标表格中,目标表格中原始也需要删除有关键字的行(注释代码中实现了,但是有8000多行,删除很耗时…
Sub DeleteEmptyRows() Dim LastRow As Long, r As Long LastRow = ActiveSheet.UsedRange.Rows.Count LastRow Step Then Rows(r).Delete Next r End Sub '删除空列 Sub DeleteEmptyColumns() Dim LastColumn As Long, c As Long LastColumn = ActiveSheet.UsedRange.Column…