我需要一次删除一行并循环直到activecell =" X" 为什么不像这项工作那么简单?
Sub SubMac4_1Loop()
Do Until ActiveCell.Value <> "X"
Selection.EntireRow.Delete
Loop
End Sub
答案 0 :(得分:2)
你的叙述与你的代码直接矛盾。
删除行,直到ActiveCell等于 X 。
Sub SubMac4_1Loop()
Do Until ActiveCell.Value = "X"
Selection.EntireRow.Delete
Loop
End Sub
删除行,直到ActiveCell不等于 X 。
Sub SubMac4_1Loop()
Do Until ActiveCell.Value <> "X"
Selection.EntireRow.Delete
Loop
End Sub
答案 1 :(得分:1)
Do Until ActiveCell.Value <> "X"
只要NOT activecell不是X =&gt;做活动的单元格= x
Do While ActiveCell.Value <> "X"
或
Do Until ActiveCell.Value = "X"
会这样做