Code:
=IFERROR(IFERROR(VLOOKUP(RIGHT(A1,LEN(A1)-FIND(",",A1)-1),2,FALSE),RIGHT(A1,LEN(A1)-FIND(",",A1)-1)),A1))
The formula takes the State from a City&State field (i.e. New York, NY) or in case there are multiple commas then it will take everything before the last comma i.e. Luganville, Santos, PR >> PR) or in case there are no commas it will keep the whole value in tact
How do I convert this formula to VBA?