【发布时间】:2016-02-11 20:19:39
【问题描述】:
如果执行复制/粘贴然后删除该行,我有下面的代码(循环)在我的电子表格(D 列)中搜索 0。在所有过滤的 0 之后(该列被 A 列过滤 - 重复)我告诉它结束 sub。但我发现发现是在过滤的隐藏行中找到 0,所以循环继续进行。
如何使查找仅在可见行上工作,然后在处理完所有 0 时结束。
Set RangeObj = Cells.Find(What:="0", After:=ActiveCell, _
LookIn:=xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, _
SearchDirection:=xlNext, MatchCase:=False)
If RangeObj Is Nothing Then RangeObj.Activate
Cells.Find(What:="0", After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _
xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
, SearchFormat:=False).Activate
【问题讨论】: