|
本帖最后由 爱疯 于 2016-8-18 11:29 编辑
Sub a()
Dim a%, b&
For b = 1 To [a65536].End(3).Row
For a = 1 To 7
Cells(b, a).Select
If Cells(b, a) = "测试" Then
Rows(b).Delete
End If
Next
Next
End Sub
这代码,数据一多就卡死,很慢很慢
怎么办呀?
- Sub test()
- With Range([a1], "g" & [a1].End(4).Row)
- .Replace what:="测试", replacement:="=1/0", lookat:=xlWhole, _
- searchorder:=xlByRows, MatchCase:=False, searchformat:=False, _
- ReplaceFormat:=False
- .SpecialCells(xlCellTypeFormulas, 16).Select
- End With
- selection.EntireRow.Delete
- End Sub
复制代码试试这段代码
|
|