View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
alan_stew alan_stew is offline
external usenet poster
 
Posts: 9
Default problem changing password

Dave...In your code you are looping through the worksheets, but
'ActiveSheet' keeps referring to whatever sheet is active when the code
starts running, unless you change that.
The easiest fix would seem to me to be to change "ActiveSheet" in the
code below to "ws".
My guess is that's all you need to do the trick.
Alan

For Each ws In ActiveWorkbook.Worksheets
If ws.Name Like "*Monthly" Then
ActiveSheet.Unprotect Password:=sPWORD1 <---- Password not
correct
ActiveSheet.Protect Password:=sPWORD2
End If

Next

Any ideas on what I'm missing?

Thanks.