Skip to content
This repository has been archived by the owner on Jan 1, 2020. It is now read-only.

Receiving Runtime Error 424 Object Required from Enumerable.Contains #10

Open
rubberduck203 opened this issue Oct 9, 2014 · 1 comment
Labels

Comments

@rubberduck203
Copy link
Owner

Enumerable.Contains

This code causes Runtime Error 424.

For Each cell In Range("C3:C8056")
     If Not (e.Contains(cell.Value)) Then
         columnD.Add (cell.value)
     End If
 Next cell

Can be worked around by using compareByDefaultProperty option.

For Each cell In Range("C3:C8056")
    If Not (e.Contains(cell, True)) Then
        columnD.Add (cell.value)
    End If
Next cell
@malachi26
Copy link

I didn't implement the feature properly

For Each cell In Range("C3:C" & lastCRow)
    If Not (e.Contains(cell.value, True)) Then
        columnD.Add (cell.value)
    End If
Next cell

if I call Contains(cell.value, True) it works properly as long as I don't try to pass a null cell to the function.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants