Hi,

I have a vlookup formula in my vba code, and it basically goes through a array checking all accounts. But right now, it crashes if an account in present in the vlookup.

I am basically looking to run the vba and if it finds a #NA, instead of shutting code, it should keep running and saving all the vlookup values in an array that gave the error.

For example,
Vlookup runs to find account number 123, then it goes to the next account number 124 but its not in the list, instead of crashing I want the another array save this account number and go to the next account number.

If IsError(FoType = Trim(Application.VLookup(TransArray(x).AccountNum, Sheet17.Range("$A:$G"), 7, False))) Then
            MsgBox "Account Missing: " & TransArray(x).AccountNum
            
        Else
            FoType = Trim(Application.VLookup(TransArray(x).AccountNum, Sheet17.Range("$A:$G"), 7, False))
            FoCurrency = Trim(Application.VLookup(TransArray(x).AccountNum, Sheet16.Range("$A:$G"), 3, False))
        End If