Reverse Matrix lookup?
From S100 thru X105:
xxx 2001 2002 2003 2004 2005
dogs 1 2 3 4 5
cats 10 9 8 7 6
pigs 11 12 13 14 15
fish 20 19 18 17 16
birds 21 22 23 24 25
a 5x5 with titles
Function titles(r As Range, v As Integer) As String
Dim rr As Range, s1, s2 As String, gotit As Boolean
titles = ""
gotit = False
For Each rr In r
If rr.Value = v Then
gotit = True
Exit For
End If
Next
If gotit = False Then Exit Function
s1 = Cells(r.Row, rr.Column)
s2 = Cells(rr.Row, r.Column)
titles = s1 & Chr(10) & s2
End Function
=titles(S100:X105,12) will display:
"2002
pigs"
--
Gary's Student
"CLR" wrote:
Hi All......
I have a small 5x5 matrix on a worksheet. Normally one supplies the Row
and Column Titles of a matrix to return the crossover value. I want to do it
in reverse. I want to supply the crossover value and in return get the Row
and Column Titles from the matrix, (not the Excel cell address).
TIA for any assistance,
Vaya con Dios,
Chuck, CABGx3
|