View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Richhall[_2_] Richhall[_2_] is offline
external usenet poster
 
Posts: 41
Default use Find without hardcoded value but a value from a cell

Hi

I am trying to search within Excel VBA a value in a sheet dependant on
the entry in another cell. But not sure how to put a paramater as the
What part of the Find.

Can anyone help please?

i.e if cell A1 is Cat then I would search for Cat in the other sheet.

Dim Animalname

AnimalName = Combo1.Value

Sheets("Animals").Select


Cells.Find(What:=Animalname,After:=ActiveCell, LookIn:=xlFormulas,
LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:= _
False, SearchFormat:=False).Activate