View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson[_3_] Dave Peterson[_3_] is offline
external usenet poster
 
Posts: 2,824
Default protection and macros

Add a couple of lines to your macro:

worksheets("sheet1").unprotect password:="hi"
'your sort code
worksheets("sheet1").protect password:="hi"

Sam wrote:

I need to protect a worksheet, but users need to be able
to click a button that runs a macro (which sorts the
protected information). How can I protect it, while
still allowing the macro button to work? Thanks!


--

Dave Peterson