I know you have had other replies, but ...
Notice that all the Excel functions are given one or more capital letters by the
VBA editor.
Notice that substring hasn't got any. I.e. substring is not recognised. Get in
the habit of noticing this, as it's a dead giveaway.