well thanks for you help got it working just fine. Didnt realise at first that it had to be placed in a module outside of a macro. thanks again!