Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/batch-file/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Excel VBA-单元格值包含';米格';_Excel_Vba - Fatal编程技术网

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