i understand how this would work but where would i place it in the the vba editor as it is a seperate sub function so it will not fit in with the rest of the code