Sub delRows()
Dim cl As Range
Dim uRng As Range
Dim rng As Range
Dim x As Long
Set uRng = ActiveSheet.UsedRange
For Each cl In uRng
If cl.Value = "0" Or cl.Value = "1" Or cl.Value = "2" Or cl.Value = "3" Then
If x = 0 Then
Set rng = cl
x = 1
Else: Set rng = Union(rng, cl)
End If
End If
Next cl
rng.EntireRow.Delete
End Sub
這是我寫的當前宏...它在整個頁面中搜索值; 0,1,2或3,然後刪除該行。沒關係。現在這個功能它工作得很好......我有問題改變它只是掃描單個列的這些值,然後刪除該行..我不斷收到錯誤。假設我想讓它只在工作表中的列「J」中搜索?有誰知道如何解決這個問題?Microsoft Excel 2010:幫助宏製作工作
工作得很好,非常感謝! – Leaum 2011-05-19 19:44:40