![]() |
|
#15
|
|||
|
|||
|
Ok, but can I ask why? To a lot of people, the word "Error" carries connotations of bad or a mistake. The computer makes no such distinction. Error is just a condition as is No Error.
Just for the sake of an example, lets assume each grain of sand on the beach is etched with a unique ID. You need to find (if it exists) and pick up the grain with the ID "1234" There is the loop, which works but could take a tremendously long time: For Each oGrain In Beach.Grains If oGrain.ID = "1234" Then 'Whatever" Exit For End If Next Or the explicit Set method using an Error handler. Always fast. On Error Resume Next Set oGrain = Beach.Grains("1234") On Error GoTo 0 If Not oGrain is Nothing Then 'Whatever End If |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Help with Case and Select case | brent chadwick | Word VBA | 34 | 10-18-2015 02:13 PM |
| Replace & case | Jennifer Murphy | Word | 1 | 02-11-2013 03:26 AM |
A macro that can insert FILENAME, sendkeys CTRL ALT T, paste clipboard, and nextline
|
kyjac85 | Word VBA | 13 | 09-20-2012 05:00 PM |
| Problem with the sendkeys in Win7 | vidyapakki | Excel Programming | 1 | 05-07-2012 11:10 PM |
From all UPPER CASE to Proper Case
|
davers | Word | 1 | 04-30-2009 12:41 PM |