View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Kinne Kinne is offline
external usenet poster
 
Posts: 3
Default Find instruction fails (from foreign sheet)

This code works when I call it from a button on the actual sheet that
has to be querried:

Cells.Find(What:="search something", _
After:=ActiveCell, _
LookIn:=xlValues, _
LookAt:=xlPart, _
SearchOrder:=xlByColumns, _
SearchDirection:=xlNext, MatchCase:=False).Activate

This code doesn't work and produces an error "1004 - Active method of
Range class failed" when triggered from another sheet than the one
that has to be querried:

Worksheets("Sheet1").Range("Database").Cells.Find( What:="search
something", _
After:=ActiveCell, _
LookIn:=xlValues, _
LookAt:=xlPart, _
SearchOrder:=xlByColumns, _
SearchDirection:=xlNext, MatchCase:=False).Activate

It must be because of "Worksheets("Sheet1").Range("Database")."... but
what is wrong???

Thanks for any help advice...

Kinne