I use the following formula to extract postcodes from addresses and it works perfectly.
TRIM(RIGHT(SUBSTITUTE(A2,"",REPT(" ",10)),20))<o:p></o:p>
However, when I insert the same formula in a vba loop, it does not allow me to execute. REPT is highlighted and the dialogue box says "Compile...