【发布时间】:2019-02-08 19:45:17
【问题描述】:
您好,我正在开发一个宏以在一系列字符串中查找 Flex 一词,但我需要设置另一个值,并在其旁边创建一个列。但我不知道如何遍历所有单元格直到最后一行,并为找到的每个值在下一个单元格和列中设置另一个值。
Sub Method2()
Dim rng1 As Range
Dim strSearch As String
strSearch = "Flex"
Set rng1 = Range("A:A").Find(strSearch, , xlValues, xlPart)
If Not rng1 Is Nothing Then
MsgBox "Find has matched " & strSearch & vbNewLine & "corresponding cell is " & rng1.Offset(0, 1)
Else
MsgBox strSearch & " not found"
End If
结束子
【问题讨论】: