Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
On Error Resume Next | Excel Programming | |||
On Error Resume Next | Excel Programming | |||
On Error Resume Next | Excel Programming | |||
ON ERROR RESUME NEXT | Excel Programming | |||
On Error Resume Next | Excel Programming |