finding value in a hidden sheet

  • Thread starter Thread starter caroline
  • Start date Start date
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
 
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
 
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.
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top