excel - 检查是否在 VBA 列中找到多个列出的值
问题描述
如果在 A 列中找不到所有三个值,我想确保在 A 列中找到值 PF、AD、FF 显示错误。我的代码在下面请帮助我。
Sub Check_All()
Dim sht As Worksheet
Dim c As String
Dim d As String
Dim e As String
Dim lastrow As Long
Dim i As Long
Dim mycell As Range
Set sht = Sheets("sheet4")
lastrow = sht.Range("A" & Rows.Count).End(xlUp).Row
c = "PF"
d = "AD"
e = "FF"
Set mycell = sht.Range("A2:A" & lastrow).Find(what:=c & d & e, LookIn:=xlValues)
If mycell Is Nothing Then
Else
MsgBox "Error"
End If
Exit Sub
End Sub
解决方案
推荐阅读
- sql-server - 在 Python 中执行许多问题 CSV 到 Microsoft SQL Server
- firebase - Vue firebase 托管环境变量
- html - 如何在列 div 的中间垂直和水平对齐文本?
- html - 堆叠 css 网格元素
- python - 获取嵌套字典的最大值
- c# - xamarin device owner self upgrade only updates manifest, not executables
- django - 如何使用已经存在的 Django 应用程序制作 DRF?
- hyperledger-fabric - fabcar 示例中是否缺少 connection-org1.json?
- python - 根据缺失的时间范围自动填充数据库中的缺失行
- ruby-on-rails - CSV::MalformedCSVError: 新行必须是 <"\n\r">