Sub
FindValue()
Dim rng As Range
Set rng = Columns("A").Find(What:="findvalue", LookIn:=xlValues, lookat:=xlPart)
If Not rng Is Nothing Then
MsgBox "Found the value in cell " & rng.Address
MsgBox "The value was not found in column A"
End If
End Sub
其中,What 参数表示要查找的值;LookIn 参数表示在哪里查找,这里是 xlValues 即单元格的值;lookat 参数表示如何查找,这里是 xlPart 即只匹配部分字符。