This code works until input the coding between the ********** I'm trying to do two different searches at the same time. Can someone explain what I'm doing wrong? Thanks
Public Sub Swap()
With Sheet1.Range("A:A")
Set LastCell = .Cells(.Cells.Count)
End With
Set FoundCell = Sheet1.Range("A:A").Find(what:=cusip, after:=LastCell)
If Not FoundCell Is Nothing Then
FirstAddr = FoundCell.Address
End If
Do Until FoundCell Is Nothing
account = Sheet1.Cells(FoundCell.Row, 2)
''#*************************************
Set FoundCell2 = Sheet2.Range("B:B").Find(what:=account)
If Not FoundCell2 Is Nothing Then
FirstAddr2 = FoundCell2.Address
End If
''#*********************************************
Set FoundCell = Sheet1.Range("A:A").FindNext(after:=FoundCell)
''#Break out of loop when searched through all of the cusips
If FoundCell.Address = FirstAddr Then
Exit Do
End If
Loop
End Sub