Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Corner920,
You don't have to select the searched cell in order to get the value. Try something like this: Sub Test() With Columns("A:A") MsgBox .Find( _ What:=1, _ After:=.Cells(1), _ LookIn:=xlValues, _ LookAt:= _ xlWhole, _ SearchOrder:=xlByRows, _ SearchDirection:=xlNext) _ .Offset(0, 1).Value End With End Sub or a slightly shorter version: Sub Macro5() With Columns("A:A") MsgBox .Find(1, .Cells(1), xlValues, _ xlWhole, xlByRows, xlNext).Offset(0, 1).Value End With End Sub Regards, KL "Corner920" wrote in message ... How do I select the first occurance of a certain number in a column and then, as in the "Lookup" function, return a same numbered cell (different column). I have "0's" and "1's" in my column (intermixed) and I am looking for the first occurance of a "1". I then want to look up another value in the same row (different column). "Lookup" function doesn't work if you have multiple values not sorted. I'm using Excel 2003. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Select number from leftmost column that has one | Excel Discussion (Misc queries) | |||
Select range using row and column number addresses | Excel Discussion (Misc queries) | |||
How to define and select the last (bottom) number in a column? | Excel Worksheet Functions | |||
Count occurance of largest duplicate number in a single column ran | New Users to Excel | |||
Locating Cell Number of first occurance of data in Column | Excel Programming |