Name
range
.Find(What
, [After
], [LookIn
], [LookAt
]), [SearchOrder
], [SearchDirection
], [MatchCase
], [MatchByte
], [SearchFormat
])
Synopsis
Returns a Range
object representing the cell containing the first occurrence of the specified item within the specified range.
Argument |
Settings |
---|---|
|
The item to search for. Can be a string or Excel data type. |
|
The cell after which the search begins. |
|
Specify |
|
|
|
|
|
|
|
False (default) ignores case; True performs a case-sensitive search. |
|
If double-byte language support is enabled:
|
SearchFormat |
True uses the |
The following code selects the first cell in row A that contains the string "Ichiro"
. Note that the code checks whether the Find
method returns Nothing
. If you don’t check for Nothing
and the Find
item isn’t found, the Select
method returns an error.
Dim r As Range Dim foundCell As Range ...
Get Programming Excel with VBA and .NET now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.