【发布时间】:2017-09-08 19:19:58
【问题描述】:
我正在尝试遍历 Excel 电子表格中包含字符串的一系列单元格。如果特定单元格包含特定字符串,我想用相同的字符串替换整个单元格。我输入了我认为应该工作的内容,但我什么也没得到。任何帮助,将不胜感激!
Sub Supportclean()
Dim c As Range
Dim celltext As String
For Each c In Range("E:E")
If InStr(1, celltext, "horse") > 0 Then
Range(c) = "horse"
End If
Next c
End Sub
非常感谢!
【问题讨论】:
-
celltext未设置为任何值