作者:东儿2502858537 | 来源:互联网 | 2023-02-05 14:38
我想在包含特定字符串的工作表中找到一个单元格。
我不会确切知道电子表格中将包含多少列或行,因此为什么要使用CurrentRegion
。
这是我正在尝试的:
=FIND("Data String", Range("A1").CurrentRegion)
Pᴇʜ..
5
您应该查看Microsoft参考:Range.Find方法(Excel)。
.Find(What, After, LookIn, LookAt, SearchOrder, SearchDirection, MatchCase, MatchByte, SearchFormat)
例:
Dim rngFound as Range
With Worksheets("MySheetName").Cells
Set rngFound = .Find("MySearchString", LookIn:=xlValues)
If Not rngFound Is Nothing Then
'something is found
else
'nothing found
End If
End With
搜索整张纸
1> Pᴇʜ..:
您应该查看Microsoft参考:Range.Find方法(Excel)。
.Find(What, After, LookIn, LookAt, SearchOrder, SearchDirection, MatchCase, MatchByte, SearchFormat)
例:
Dim rngFound as Range
With Worksheets("MySheetName").Cells
Set rngFound = .Find("MySearchString", LookIn:=xlValues)
If Not rngFound Is Nothing Then
'something is found
else
'nothing found
End If
End With
搜索整张纸