|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
此代码运行数据5000票以上就很慢了 请问有什么办法可以优化这代码
Sub zzf()
Dim i As Integer, iCount As Integer
Dim x As Integer, xCount As Integer
xCount = [a65536].End(xlUp).Row
With Sheets("sheet2")
iCount = .[a65536].End(xlUp).Row
For x = 2 To xCount
For i = 2 To iCount
If Cells(x, 2) = "" Then
If Cells(x, 1) = .Cells(i, 2) Then
Cells(x, 2) = .Cells(i, 1)
Cells(x, 3) = .Cells(i, 17)
Cells(x, 4) = .Cells(i, 18)
Cells(x, 5) = .Cells(i, 19)
Cells(x, 6) = .Cells(i, 20)
Cells(x, 7) = .Cells(i, 21)
Cells(x, 8) = .Cells(i, 22)
Cells(x, 9) = .Cells(i, 23)
Cells(x, 10) = .Cells(i, 16)
End If
End If
Next
Next
End With
End Sub
|
|