vba - 使用“LookIn:=xlFormulas”查找似乎不适用于我的表
问题描述
我怎样才能让它在隐藏的行中查看?这只有在我每次都过滤我的表时才有效。我原以为“LookIn:=xlFormulas”可以解决问题,但事实并非如此。
Sub MarkCompleted1()
Application.ScreenUpdating = False
Range("Table1[[#Headers],[SO'#]]").Select
If Range("C:C").Find(What:=Range("S1").Value, After:=ActiveCell, _
LookIn:=xlFormulas, LookAt:=xlWhole, MatchCase:=False) _
Is Nothing Then
ActiveSheet.Range("S1").Select
MsgBox "Sales Order # " & Range("S1") & " Not Found", _
vbInformation, "Information"
Else:
Range("C:C").Find(What:=Range("S1").Value, After:=ActiveCell, _
LookIn:=xlFormulas, LookAt:=xlWhole, MatchCase:=False).Activate
MarkCompleted2
End If
End Sub
解决方案
工作表的 MATCH 函数查找隐藏的行和列。
Sub MarkCompleted1()
dim m as variant
m = application.match(Range("S1").Value, columns(3), 0)
If iserror(m) Then
Range("S1").Select
MsgBox "Sales Order # " & Range("S1") & " Not Found", vbInformation, "Information"
Else
Range("C" & m).Activate
MarkCompleted2
End If
End Sub
推荐阅读
- java - 如何从 .dat 文件中读取整数/双精度数据类型?
- kubernetes - 如何在 K8s 中管理服务帐户令牌的使用?
- javascript - 动态 Formik 表单数据填充抛出受控输入错误
- node.js - 如何从用户那里接受 Node js 中的时间
- symfony - Symfony 控制器即服务问题与测试速度
- nginx - 如何在 Nginx 访问日志中记录 grpc 状态?
- javascript - “typeof 导入”类型上不存在属性“render”
- excel - 循环引用和迭代在 Excel 中的工作原理
- qt - 如何在 Qml 的 ListView 中添加搜索选项
- r - 使用闪亮的应用程序更新 Docker 容器内的文件