Excel VBA Find Function getting runtime Error 1004
<p>Every time I try to run this code I get this error:
'Runtime error 1004: Application defined or Object defined error'
It specifically is not liking the "Find" Function, with out it, it runs fine. </p>

<p>My Code looks like this:</p>

<pre><code>Public Sub main()
    Dim maxVal As Long
    Dim origValue As Long
    Dim CaseNumber As Long
    Dim FoundCell As Range

maxVal = Range("A1").End(xlDown).Row
For origValue = 2 To maxVal
    CaseNumber = Sheets("Complications").Cells(origValue, 1).Value
    FoundCell = Sheets("Complications").Cells.Range(a1, a50000).Find(What:=CaseNumber)
    If FoundCell Is Nothing Then
        Sheets("Complications").Cells(origValue, 1).Value = Sheets("Cases").Cells(origValue, 1).Value
    Else
    End If

    Next
End Sub
</code></pre>

<p>Any help would be much appreciated!</p>