vba搜索当前sheet页是否有该字符串怎么写啊
来源:百度知道 编辑:UC知道 时间:2024/06/01 06:50:15
Sub dd()
Dim ss As Range
Set ss = ActiveSheet.Cells.Find(What:="要找的字符串", After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
, MatchByte:=False, SearchFormat:=False)
If ss Is Nothing Then
MsgBox "未找到"
Else
ss.Activate
MsgBox ss.Value
End If
End Sub