hi again,

the above did not solve this although it did give the sheet a password afterwards. i then tried the second code you gave me and now it comes up with compile error: sub or function not defined then highlights worksheet in blue after set tmpbox = worksheet on line 4 of your code.
I did have your codes always posted on the correct sheet and i did change "targetsheet" to the correct sheet name also.