I am using the following formula in a Macro to sort names by lastName, firstName middleInitial:
Range(“C6”).Formula = “= IF(A6<>“”,(TRIM((MID(B6,FIND(” “,B6)+1,LEN(B6)-FIND(” “,B6))) & “, ” & TRIM(LEFT(B6,FIND(” “,B6))))),””)”
My issue is that when I place this in an excel cell it rearranges the names perfectly but when I place it into VBA I get a “mismatch” error once I run the macro! Any ideas?