View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Nigel Nigel is offline
external usenet poster
 
Posts: 923
Default How to run Macro functionality for a protected worksheet

You need to include in your macro an unprotect statement, then reprotect
after the code is complete, replace the sheet name as required......

sub Test()

Sheets(1).Unprotect

'your code here!

Sheets(1).Protect DrawingObjects:=True, Contents:=True, Scenarios:=True

end sub


if you need to use a password then change it to.........

Sheets(1).Unprotect Password:="MyPassword"

Sheets(1).Protect DrawingObjects:=True, Contents:=True, Scenarios:=True,
Password:="MyPassword"



--
Cheers
Nigel



"aflriwanna" wrote in message
...
i wanna what to know :-
run macro functionality for a protected worksheet