Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
lookup, intersect, find ?
This assumes the value of animal and color will be found.
Dim val as Variant Dim rng1 as Range, rng2 as Range set rng1 = Range(Cells(1,1),Cells(1,2).End(xltoRight)) set rng2 = Range(Cells(1,1),Cells(2,1).End(xldown)) val = Cells(rng2.Find(color).row, rng1.Find(animal).Column).Value -- Regards, Tom Ogilvy "Matt" wrote in message ... Ok, I've searched the groups and haven't found exactly what I'm looking for....or perhaps I'm just not understanding the solution... which is more likely the case. I have two variables; for this example we'll call them "Color" and "Animal" which are selected by users via a form. I then want to take those two variables and search a table on a worksheet to find a value. The table would look like: cat dog bird red 0.31 0.22 0.11 blue 0.55 0.61 0.69 green 0.78 0.81 0.85 So assuming the user picked "dog" and "blue" in the form, the result would be 0.61. Lookup and Intersect seem to based on already knowing the address, column, or row...is this correct? I suppose I could search row 1 for the matching Animal, then search column A for the matching Color, and then finally do a lookup on those results. Is there an easier way to do this without having to do three statements? thanks! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Intersect Line | Charts and Charting in Excel | |||
how to find an intersect of two columns | New Users to Excel | |||
How do I find where a column value and row value intersect? | Excel Worksheet Functions | |||
opposite of intersect | Excel Programming | |||
Help with If Not Intersect | Excel Programming |