Unprotecting/Reprotecting using Macro's

  • Thread starter Thread starter documike
  • Start date Start date
D

documike

I tried recording a macro, first unprotecting the sheet, doing the required
filtering etc., then reprotecting, and ending the macro. When I run the
macro, it comes up asking for a password right away. Evidently recording a
macro & doing the protection piece doesn't put the right code in the macro.
Any ideas?
 
documike. try this

ActiveSheet.Unprotect password:="123"

'you code here

ActiveSheet.Protect password:="123"
--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003
 
Back
Top