LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Correct Syntax - Collection Key

Hi All,

This may seem really easy but it has elluded me for a while.

I'm trying to figure out the correct syntax to capture an error when a
collection key is not part of the collections contents, ie.

if not colActiveCollection("NoSuchKey") IsNothing then
....
end if

The problem is that "NoSuchKey" is not in the collection. So it returns an
Object Error and not Nothing.

So how can I check the container without having to iterate over the entire
collection looking for a match?

I'm sure that the answer is below simple, so sorry for having to post such a
simple question.

Paul.
 
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
Correct Syntax TeeSee Excel Discussion (Misc queries) 6 February 28th 08 01:36 AM
Correct VBA syntax Ken G. Excel Discussion (Misc queries) 3 December 7th 05 12:35 AM
Can't get this syntax correct, please help. Sharlene England Excel Programming 4 December 1st 03 05:41 PM
ListBoxes - correct syntax Bob Phillips[_5_] Excel Programming 0 September 17th 03 02:02 PM
What is correct syntax for a CommandButton? Les[_4_] Excel Programming 1 August 4th 03 08:46 PM


All times are GMT +1. The time now is 03:06 AM.

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"