【发布时间】:2017-08-09 15:20:18
【问题描述】:
希望扫描一整列以查看产品(在单个单元格中)是否可能停产。如果单词discontinued 在一个单元格中,这是正确的。如果停产,我希望将整行隐藏起来。有什么建议吗?
Sub HideRows()
Dim c As Range
For Each c In Range("B3:B2452")
If InStr(1, c, "Discontinued") Or InStr(1, c, "discontinued") Then
c.EntireRow.Hidden = True
End If
Next
End Sub
【问题讨论】:
-
它现在给你的行为是什么?
-
已手动输入,现已更新为复制版本。
-
现在,这没有任何作用......
-
我刚试过这个,它对我有用。
-
@RonanGarrison 你为什么不使用过滤器???会更快
标签: vba excel multiple-columns cells