Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 923
Default On Error Resume Next ?

Hi All

What causes On Error Resume Next to be ignored ??

I have a piece of code that exploits the Collection limit of unique key
values only, however it still throws an error when trying to add a duplicate
key to the Collection - as if the On Error Resume Next is being ignored

Dim NoDupes As New Collection
Dim AllCells As Range, Cell As Range
Set AllCells = Range("A1:A100")

' The next statement ignores the error caused by attempting to add a
duplicate key to the collection.
On Error Resume Next
For Each Cell In AllCells
NoDupes.Add Cell.Value, CStr(Cell.Value)
Next Cell
' Resume normal error handling
On Error GoTo 0



--
Cheers
Nigel




  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default On Error Resume Next ?

Hi Nigel,

See response to earlier thread.

---
Regards,
Norman



"Nigel" wrote in message
...
Hi All

What causes On Error Resume Next to be ignored ??

I have a piece of code that exploits the Collection limit of unique key
values only, however it still throws an error when trying to add a
duplicate
key to the Collection - as if the On Error Resume Next is being ignored

Dim NoDupes As New Collection
Dim AllCells As Range, Cell As Range
Set AllCells = Range("A1:A100")

' The next statement ignores the error caused by attempting to add a
duplicate key to the collection.
On Error Resume Next
For Each Cell In AllCells
NoDupes.Add Cell.Value, CStr(Cell.Value)
Next Cell
' Resume normal error handling
On Error GoTo 0



--
Cheers
Nigel






  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 923
Default On Error Resume Next ?

Hi Norman
For some reason I cannot see my original post, it is just is not here!!
Hence my repost. If you could attach a copy of your earlier reply - much
appreciated.

--
Cheers
Nigel



"Norman Jones" wrote in message
...
Hi Nigel,

See response to earlier thread.

---
Regards,
Norman



"Nigel" wrote in message
...
Hi All

What causes On Error Resume Next to be ignored ??

I have a piece of code that exploits the Collection limit of unique key
values only, however it still throws an error when trying to add a
duplicate
key to the Collection - as if the On Error Resume Next is being ignored

Dim NoDupes As New Collection
Dim AllCells As Range, Cell As Range
Set AllCells = Range("A1:A100")

' The next statement ignores the error caused by attempting to add a
duplicate key to the collection.
On Error Resume Next
For Each Cell In AllCells
NoDupes.Add Cell.Value, CStr(Cell.Value)
Next Cell
' Resume normal error handling
On Error GoTo 0



--
Cheers
Nigel








  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default On Error Resume Next ?

Hi Nigel,

Here is a link to the thread,

http://tinyurl.com/bwtll

Note Dave Peterson's rejoinder


---
Regards,
Norman



"Nigel" wrote in message
...
Hi Norman
For some reason I cannot see my original post, it is just is not here!!
Hence my repost. If you could attach a copy of your earlier reply - much
appreciated.

--
Cheers
Nigel



"Norman Jones" wrote in message
...
Hi Nigel,

See response to earlier thread.

---
Regards,
Norman



"Nigel" wrote in message
...
Hi All

What causes On Error Resume Next to be ignored ??

I have a piece of code that exploits the Collection limit of unique key
values only, however it still throws an error when trying to add a
duplicate
key to the Collection - as if the On Error Resume Next is being ignored

Dim NoDupes As New Collection
Dim AllCells As Range, Cell As Range
Set AllCells = Range("A1:A100")

' The next statement ignores the error caused by attempting to add a
duplicate key to the collection.
On Error Resume Next
For Each Cell In AllCells
NoDupes.Add Cell.Value, CStr(Cell.Value)
Next Cell
' Resume normal error handling
On Error GoTo 0



--
Cheers
Nigel










  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 923
Default On Error Resume Next ?

Thamk you, Norman. The VBE editor was set to break on all errors, so
changing it fixed the problem :))

--
Cheers
Nigel



"Norman Jones" wrote in message
...
Hi Nigel,

Here is a link to the thread,

http://tinyurl.com/bwtll

Note Dave Peterson's rejoinder


---
Regards,
Norman



"Nigel" wrote in message
...
Hi Norman
For some reason I cannot see my original post, it is just is not here!!
Hence my repost. If you could attach a copy of your earlier reply -

much
appreciated.

--
Cheers
Nigel



"Norman Jones" wrote in message
...
Hi Nigel,

See response to earlier thread.

---
Regards,
Norman



"Nigel" wrote in message
...
Hi All

What causes On Error Resume Next to be ignored ??

I have a piece of code that exploits the Collection limit of unique

key
values only, however it still throws an error when trying to add a
duplicate
key to the Collection - as if the On Error Resume Next is being

ignored

Dim NoDupes As New Collection
Dim AllCells As Range, Cell As Range
Set AllCells = Range("A1:A100")

' The next statement ignores the error caused by attempting to add

a
duplicate key to the collection.
On Error Resume Next
For Each Cell In AllCells
NoDupes.Add Cell.Value, CStr(Cell.Value)
Next Cell
' Resume normal error handling
On Error GoTo 0



--
Cheers
Nigel












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
On Error Resume Next Nigel Excel Programming 3 August 10th 05 03:34 PM
On Error Resume Next Stefi Excel Programming 6 July 8th 05 11:52 AM
On Error Resume Next Jasper Excel Programming 4 May 12th 05 12:08 PM
ON ERROR RESUME NEXT D.S.[_3_] Excel Programming 7 December 1st 03 09:40 AM
On Error Resume Next D.S.[_3_] Excel Programming 1 November 28th 03 04:52 PM


All times are GMT +1. The time now is 11:13 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"