【发布时间】:2020-09-29 13:22:40
【问题描述】:
我很确定我快到了。目前这会删除所有行。
我只是希望它删除标识为其中包含单词FALSE 的行。
Dim R As Range
Dim myRange As Range
LastRow = Range("A" & Rows.Count).End(xlUp).Row
Set myRange = Range("U2:U" & LastRow)
For Each R In myRange
If R.Value = "FALSE" Then
Rows.Delete
End If
Next
我也尝试过使用下面的代码,但没有帮助。
Dim R As Range
Dim myRange As Range
LastRow = Range("A" & Rows.Count).End(xlUp).Row
Set myRange = Range("U2:U" & LastRow)
For Each R In myRange
If R = "False" Then
R.EntireRow.Delete
End If
Next```
【问题讨论】:
-
这能回答你的问题吗? Clear Cell Contents of range if Contes = 0
-
不,它没有。我将添加到原始帖子中,以及我尝试过的内容。对不起。
-
这个回答吗? Delete row based on partial text 无需循环。您可以使用
Autofilter1 次删除相关行。 -
BTW 如何将“False”存储在单元格中?作为字符串还是布尔值?也许您可以添加屏幕截图?
-
@SiddharthRout 图片已添加。是字符串吗?