View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
goober
 
Posts: n/a
Default Allow user to run a macro in protected mode


The cells you are manipulating have to be unprotected during the
manipulation.

You can do this by putting this piece of code at the beginning of your
macro.

Dim Code
Code = "password"
Worksheets("sheetname).Unprotect (PrivCode)

Then at the end of your code put this

Worksheets("sheetname).Protect (PrivCode)

You will have to password protect your VBA editor for that Workbook but
this will allow the macro to change the sheet as it needs to.


--
goober
------------------------------------------------------------------------
goober's Profile: http://www.excelforum.com/member.php...o&userid=19838
View this thread: http://www.excelforum.com/showthread...hreadid=487761