擅长:python、mysql、java
<p>我不完全确定您要做什么,但我怀疑问题是您嵌套了复制循环。</p>
<p>请尝试以下操作:</p>
<pre><code>row_nr = 1
for row in ws1:
for cell in row:
if cell.value == "TrueValue":
row_nr = cell.row
break
if row_nr > 1:
break
for row in ws1.iter_rows(min_row=row_nr, max_col=190):
ws2.append((cell.value for cell in row))
</code></pre>