![]() |
finding value in a hidden sheet
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 |
finding value in a hidden sheet
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 -- Regards Frank Kabel Frankfurt, Germany caroline wrote: 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 |
finding value in a hidden sheet
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. -----Original Message----- 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 -- Regards Frank Kabel Frankfurt, Germany caroline wrote: 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 . |
finding value in a hidden sheet
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 -- Regards Frank Kabel Frankfurt, Germany "caroline" schrieb im Newsbeitrag ... 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. -----Original Message----- 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 -- Regards Frank Kabel Frankfurt, Germany caroline wrote: 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 . |
All times are GMT +1. The time now is 12:25 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com