views:

45

answers:

2

Hi ,

is there a function in excel which can find the index of the row for a particular value É

ie if I write function(5.77) it will return 5 , because 5.77 appears in row 5 .

'1 Frequency '2 4.14 '3 4.19 '4 5.17 '5 5.77 '6 6.39

A: 

The function is called MATCH. It doesn't return the row number, but it returns the index of the cell inside the range, you can add the base row number to that to get the actual row number.

PS. This is an excel function used in cell formulas, not an excel-vba function...

Aviad P.
can I use the function with macro É hwo would it look like É
excel34
+1  A: 

You can use the MATCH() worksheet function. In order to use this in VBA, you need to use the WorksheetFunction object, which exposes a subset of the Excel worksheet functions. E.g.

Dim rowIndex as Long
rowIndex = WorksheetFunction.Match(5.77, Range(A1:A6))
AdamRalph