In column B, I have data for eg hmc1, hmc2, hmc3. I want to find every Column B cell that contains "hmc" and replace its corresponding cell in Column A with "Found". My code so far works if it matches fully, but not if it matches a substring.
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
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.