請教如何不用 FOR迴圈,快速的刪掉特定的列和多個特定的列?
目前是使用 FOR 迴圈,但時間太長,有更好、更聰明的方法嗎?
Intersect 方法 可以辨的到的嗎???
Sub 看青木()
AAA = Range("B65536").End(xlUp).Row
For x = 2 To AAA
d = Cells(x, 2)
If Cells(x, 2) <> 1 Then '
Rows(x).Delete
x = x - 1
AAA = Range("B65536").End(xlUp).Row
If x >= AAA Then Exit For
End If
Next x
End Sub
================================================
Sub 看阿久津等五人()
AAA = Range("B65536").End(xlUp).Row
For x = 2 To AAA
d = Cells(x, 2)
If Cells(x, 2) = 1 Or Cells(x, 2) = 3 Or Cells(x, 2) = 5 Or Cells(x, 2) = 7 Or Cells(x, 2) = 9 Then '
Rows(x).Delete
x = x - 1
AAA = Range("B65536").End(xlUp).Row
If x >= AAA Then Exit For
End If
Next x
End Sub