Yes, that line is incorrect because you are trying to set a range equal to a value. Similar for the other range.
Also, for the Find method to work, the value being searched for must be visible so we do need to make sure that the 'Data' sheet is not filtered, so I have put an equivalent line back in the code.
Your MsgBox would also produce an error for the Loan numbers not found.
Try these changes
Rich (BB code):
Sub Delete_Closed_Loans_v2()
ActiveSheet.Unprotect Password:="Mortgage1"
Dim cell As Range, rngData As Range, rngMain As Range, LoanFound As Range
With Sheets("Data")
If .FilterMode Then .ShowAllData
Set rngData = .Range("C11:C" & .Range("C" & Rows.Count).End(xlUp).Row).Value2
Set rngData = .Range("C11:C" & .Range("C" & Rows.Count).End(xlUp).Row)
End With
With Sheets("Main")
Set rngMain = .Range("A8:A" & .Range("A" & Rows.Count).End(xlUp).Row).Value
Set rngMain = .Range("A8:A" & .Range("A" & Rows.Count).End(xlUp).Row)
End With
For Each cell In rngMain
Set LoanFound = rngData.Find(What:=cell.Value, LookIn:=xlValues, LookAt:=xlWhole)
If LoanFound Is Nothing Then
'Put your code here for MsgBox/Delete etc
MsgBox "Hello " & LoanFound
MsgBox cell.Value & " loan not found"
End If
Next cell
End Sub