Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
joeeng
 
Posts: n/a
Default check if worksheet exists

How can I check if a worksheet exists before trying the access it? I've been
using the if text on an iserror for an indirect function, but this causes the
calculation to be very slow when entered into many cells.
  #2   Report Post  
Ian
 
Posts: n/a
Default

It sounds like the sheet is slow because each cell with the formula is
checking the hard disk for the file. Try putting the sheet check into just
one cell giving say 0 for non-existing & 1 for existing, then use an if
condition in the other cells to check that cell?


--
Ian
--
"joeeng" wrote in message
...
How can I check if a worksheet exists before trying the access it? I've
been
using the if text on an iserror for an indirect function, but this causes
the
calculation to be very slow when entered into many cells.



  #3   Report Post  
joeeng
 
Posts: n/a
Default

I have a situation where there may be up to 250 sheets, say A1, A2,...,A250,
but usually there will be many less than 250, say A1, A2,...,A50, but I have
to check the whole 250 because the number of existing sheets will not
automatically be known. In this case I do have to check all 250 possible
sheets to see just how many exist. Accessing each one and checking if it is
an error takes a very long time to calculate the initial cell values upon
opening the file and upon recalculation of the cell values. There should be
a way to check if a sheet exists without actually trying to access it with an
INDIRECT function. Thanks.

"Ian" wrote:

It sounds like the sheet is slow because each cell with the formula is
checking the hard disk for the file. Try putting the sheet check into just
one cell giving say 0 for non-existing & 1 for existing, then use an if
condition in the other cells to check that cell?


--
Ian
--
"joeeng" wrote in message
...
How can I check if a worksheet exists before trying the access it? I've
been
using the if text on an iserror for an indirect function, but this causes
the
calculation to be very slow when entered into many cells.




  #4   Report Post  
Ian
 
Posts: n/a
Default

I've never used it, but I see there is a FileExists method in Excel VBA.
Perhaps you could have a look at that. As I say, I've never used it, so I
can't advise you further. Sorry

--
Ian
--
"joeeng" wrote in message
...
I have a situation where there may be up to 250 sheets, say A1,
A2,...,A250,
but usually there will be many less than 250, say A1, A2,...,A50, but I
have
to check the whole 250 because the number of existing sheets will not
automatically be known. In this case I do have to check all 250 possible
sheets to see just how many exist. Accessing each one and checking if it
is
an error takes a very long time to calculate the initial cell values upon
opening the file and upon recalculation of the cell values. There should
be
a way to check if a sheet exists without actually trying to access it with
an
INDIRECT function. Thanks.

"Ian" wrote:

It sounds like the sheet is slow because each cell with the formula is
checking the hard disk for the file. Try putting the sheet check into
just
one cell giving say 0 for non-existing & 1 for existing, then use an if
condition in the other cells to check that cell?


--
Ian
--
"joeeng" wrote in message
...
How can I check if a worksheet exists before trying the access it?
I've
been
using the if text on an iserror for an indirect function, but this
causes
the
calculation to be very slow when entered into many cells.






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to protect a worksheet from being copied to another worksheet SurvivorIT Excel Discussion (Misc queries) 3 August 31st 05 01:53 PM
How do I check for existence of a worksheet? LizzieHW Excel Worksheet Functions 1 July 19th 05 06:22 PM
Linking cells in a worksheet to other worksheets in a workbook Dave Excel Discussion (Misc queries) 4 June 24th 05 06:18 PM
Macro to search for and display data in another worksheet Mark H Excel Worksheet Functions 0 June 14th 05 12:40 PM
Weekly Transaction Processing Ralph Howarth Excel Worksheet Functions 4 January 19th 05 05:37 AM


All times are GMT +1. The time now is 05:14 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"