finding value in a hidden sheet

C

caroline

My code seems to fail because I am searching a value in a
hidden sheet. Any idea?

I get the following message (runtime error 1004, activate
method out of range class failed)

Dim Cell As Range
Set Cell = Range("List").Find(What:=Range("nametofind"))
Cell.Activate

PS: list and nametofind are defined names
 
F

Frank Kabel

Hi
you can't activate a cell on a hidden sheet (but this is not necessary
in most cases). If you just want the value use
Dim Cell As Range
Set Cell = Range("List").Find(What:=Range("nametofind"))
msgbox cell.address
 
C

caroline

Thanks it works.
SO it must be something else in my code that does not
agree with the hidden sheet.
I am a bit confused, because I use "activate" all the
time on hidden sheet and it usually works.
 
F

Frank Kabel

Hi
so post your complete code :)
Note: Activate should be avoided as this will slow down your macro and
is in most cases not required
 
Top