|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
不用那么复杂,你的代码只是有小小的问题,稍稍改一下就可以了
- Sub 提取_Click()
- Dim i%, irow%, k%
- irow = Sheets("统计表").Range("a10000").End(xlUp).Row
- k = 2
- For i = 2 To irow Step 1
- If Sheets("统计表").Cells(i, 9) <> 0 And Sheets("统计表").Cells(i, 13) <> 0 And Sheets("统计表").Cells(i, 17) <> 0 Then
- Sheets("数据提取表").Cells(k, 1) = Sheets("统计表").Cells(i, 1)
- Sheets("数据提取表").Cells(k, 2) = Sheets("统计表").Cells(i, 2)
- Sheets("数据提取表").Cells(k, 3) = Sheets("统计表").Cells(i, 3)
- Sheets("数据提取表").Cells(k, 4) = Sheets("统计表").Cells(i, 4)
- Sheets("数据提取表").Cells(k, 5) = Sheets("统计表").Cells(i, 6)
- Sheets("数据提取表").Cells(k, 6) = Sheets("统计表").Cells(i, 9)
- Sheets("数据提取表").Cells(k, 7) = Sheets("统计表").Cells(i, 13)
- Sheets("数据提取表").Cells(k, 8) = Sheets("统计表").Cells(i, 17)
- k = k + 1
- End If
- Next i
- End Sub
复制代码
|
|