[英]VBA Excel Change Content of another Cell based on content of one cell
Can you help me with this. 你能帮我吗 The Excel looks something like this: Excel看起来像这样:
I hope to automate 2 tasks: 我希望自动化2个任务:
I have tried Offset, Looping and other various method but can't seem to get it right. 我尝试了偏移,循环和其他各种方法,但似乎无法正确处理。 Please help. 请帮忙。
Sub removeprocessed()
Dim Nlines As Long
Dim i As Long
Nlines = Columns(1).Find("*", , , , xlByColumns, xlPrevious).Row
For i = 2 To Nlines
If 0 <> InStr(1, Cells(i, 3).Value, "processed") Then
Cells(i, 1).Value = ""
End If
If 0 <> InStr(1, Cells(i, 3).Value, "blue") Then
Cells(i, 2).Value = 0
End If
Next
End Sub
Using InStr as proposed by @UGP 使用@UGP建议的InStr
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.