Find data in Range, Return Cell Reference
There are parms you can specify in the .address property that will show the
address as relative references.
rr.address(0,0)
or
rr.address(false,false)
without using keywords.
Gary''s Student wrote:
Try this small UDF:
Function WhereInTheWorld(rf As Range, r As Range) As String
Dim rr As Range
WhereInTheWorld = "No Luck"
v = rf.Value
For Each rr In r
If rr.Value = v Then
WhereInTheWorld = Replace(rr.Address, "$", "")
Exit Function
End If
Next
End Function
and use in the worksheet like:
=WhereInTheWorld(A1,B1:D15)
--
Gary''s Student - gsnu200846
"Hugh" wrote:
I want to see if a value in A1 is present in an array, say B1:D15, and then
return the refernce of the cell in which the value is held. The value in A1
will not occur more than once in the array.
For instance, if the value in A1=30, and 30 appears in cell D4, I want to
return D4 (or $D$4).
Is there a formula or function that will return the cell reference of cell
containing a specific value?
Thanks in advance.
--
Dave Peterson
|