Excel VBA-单元格值包含';米格';
我知道有一种方法可以查看单元格值是否包含某个字符串。我知道有些编程语言使用%…%Excel VBA-单元格值包含';米格';,excel,vba,Excel,Vba,我知道有一种方法可以查看单元格值是否包含某个字符串。我知道有些编程语言使用%…% If shtVO.Cells(Row, 1).Value <> "%MIG%" Then shtVO.Cells(Row, 1).Value = shtVO.Cells(Row, 1).Value + "MIG" End If 如果shtVO.Cells(第1行)值为“%MIG%”,则 shtVO.Cells(第1行)。值=shtVO.Cells(第1行)。值+MIG
If shtVO.Cells(Row, 1).Value <> "%MIG%" Then
shtVO.Cells(Row, 1).Value = shtVO.Cells(Row, 1).Value + "MIG"
End If
如果shtVO.Cells(第1行)值为“%MIG%”,则
shtVO.Cells(第1行)。值=shtVO.Cells(第1行)。值+MIG
如果结束
我想查看我的单元格A是否已包含MIG,如果包含,则不应更新值,如果不包含MIG,则应使用MIG更新当前值。尝试此操作
If not shtVO.Cells(Row, 1).Value like "*MIG*" Then
试试这个
If not shtVO.Cells(Row, 1).Value like "*MIG*" Then