find value in cell


Posted by tom venn on February 12, 2002 3:36 PM

hi, here is my current code:
Selection.Find(What:="2002/2", After:=ActiveCell, LookIn:=xlValues, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False).Activate

Instead of finding "2002/2" all the time, I would like to find the value in cell A1.

any help is appreciated.

thanks,

- thomas



Posted by Juan Pablo G. on February 12, 2002 7:25 PM

Try with:

Selection.Find(What:=Range("A1").Text, After:=ActiveCell, LookIn:=xlValues, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False).Activate

Note I used Range("A1").Text instead of Range("A1").Value, you may need, depending on your data, one or the other, so be sure to try with both.

Juan Pablo G.