VBA formula issue!! - TechRepublic
Question
October 22, 2010 at 11:18 AM
nulubez

VBA formula issue!!

by nulubez . Updated 15 years, 8 months ago

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?

This discussion is locked

All Comments