For highlighting middle name you can also try this as over here some people have more than one middle name lol ..... and this will work for multiple middle names or just one middle name ... again like Somendra Misra solution paste into the conditional formatting section and then choose you highlighting preference
=IF(ISERROR(FIND(" ",A4,FIND(" ",A4,1)+1)),"False","True")
This function will get you last name =REPLACE(A18,1,FIND(" ",A18,1),"") but wont work if names have a middle name .... but will have a go at that as well ..
ahh you want macro for last name sorry on file it said function .... sure Somendra Misra will sort that