Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我知道有一种方法可以查看单元格值是否包含某个字符串。我知道一些编程语言使用 % ... %。
If shtVO.Cells(Row, 1).Value <> "%MIG%" Then shtVO.Cells(Row, 1).Value = shtVO.Cells(Row, 1).Value + "MIG" End If
我想查看我的 Cell A 是否已经包含 MIG,如果包含,则不应更新值,如果不包含 MIG,则应使用 MIG 更新当前值。
试试这个
If not shtVO.Cells(Row, 1).Value like "*MIG*" Then
If InStr(0, shtVO.Cells(Row, 1).Value, "MIG", vbTextCompare)=0 Then shtVO.Cells(Row, 1).Value = shtVO.Cells(Row, 1).Value + "MIG" End If