我是VBA的新手,我正试图想出一种方法来删除网站列单元格包含单词的所有行(如果可能的话,移动单元格)none.该表包含5000多条记录,这将为我节省大量时间.
我很感激任何建议.提前谢谢了!
我试图删除使用VBA在B列中找到值"X"的每一行.但是,我有三个问题:
任何帮助将不胜感激.
Sub RemoveRows()
Dim strLookFor As String
Dim strRow As String
Worksheets("Sheet1").Range("B2").Activate
strLookFor = "X"
strRow = Range("B2").Address
Do Until ActiveCell.Value = ""
MsgBox (ActiveCell.Value)
If ActiveCell.Value = strLookFor Then
Rows.Delete (strRow)
End If
strRow = Cells.Find(what:=strLookFor).Address
Loop
MsgBox ("Deleted all rows with value " & strLookFor)
End Sub
Run Code Online (Sandbox Code Playgroud)
