View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
ben ben is offline
external usenet poster
 
Posts: 232
Default Macro doesn't work when I use Protection

unprotect your worksheet before you do your code and then protect when done
ie...
you can remove the password key word if there is no password
ie
activesheet.unprotect


sub insertrows()
activesheet.unprotect password:="enter your password here"
'insert rows edit cells whatever here
activesheet.protect password:="enter your password here"
end sub


--
When you lose your mind, you free your life.


"Janet H." wrote:

I have a macro to insert rows in my worksheet. When I turn on protection, so
user can only access unlocked cells, my macro will not work. How can I use
both the macro and the protection option?