在B栏中,我有数据,例如hmc1,hmc2,hmc3。我想找到包含" hmc"的每个B列单元格。并用"找到"替换A列中相应的单元格。 到目前为止,我的代码完全匹配,但如果匹配子字符串则不行。
If .Range("B" & r).Value = "hmc " Then
.Range("A" & r).Value = "Found"
Col A Col B
Accept hmc1
123 hmc1
123 hmc2
Accept xcc
Accept xcc
Accept xcc
Accept xcc
Accept xcc
Accept xcc
Accept xcc
Accept xcc
Accept xcc
Accept xcc
123 hmc3
Accept hmc3
Accept hmc3