ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   application.match Returns what (https://www.excelbanter.com/excel-programming/323353-application-match-returns-what.html)

Ben

application.match Returns what
 
I can not find any documentation on application.Match method
what is the proper syntax, what does it return
bagno = Search String
rng = "range to lookup"
I wish to return the the row of a found item or return a null if not found
in a certain range or would you reccomend find instead

Dick Kusleika[_4_]

application.match Returns what
 
Ben

It's the same syntax as the worksheet function.

Match(bagno,RangeObject,TrueOrFalse)

so an example might be

x = Application.Match(bagno,Sheet1.Range("A1:A10"),Fal se)

See also, here

http://www.dicks-blog.com/archives/2...nction-method/

Match will return the row relative to the range. If you provide
Range("E50:E60"), and Match returns 1, it's really row 50. If you want the
actaul row, use the Find method

Dim rFound As Range

rFound = Sheet1.Range("E50:E60").Find(What::=bagno)

If Not rFound Is Nothing Then
x = rFound.Row
End If

More info on Find
http://www.dicks-blog.com/archives/2...e-find-method/

--
Dick Kusleika
Excel MVP
Daily Dose of Excel
www.dicks-blog.com

ben wrote:
I can not find any documentation on application.Match method
what is the proper syntax, what does it return
bagno = Search String
rng = "range to lookup"
I wish to return the the row of a found item or return a null if not
found in a certain range or would you reccomend find instead





All times are GMT +1. The time now is 03:42 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com