View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ron de Bruin Ron de Bruin is offline
external usenet poster
 
Posts: 11,123
Default Macros on protected sheets?

Hi Karen

You can unprotect your sheet in the code
and protect it again after your code is ready.

Sheets("Sheet1").Unprotect "ron"
' your code
Sheets("Sheet1").Protect "ron"


But I like this way.

Protect your worksheets with code like this
Place this in the Thisworkbook module.

The macro's will be working now
It will only protect the userfaceonly

Private Sub Workbook_Open()
Dim sh As Worksheet
Application.ScreenUpdating = False
For Each sh In ThisWorkbook.Worksheets
sh.Protect userinterfaceonly:=True
Next sh
Application.ScreenUpdating = True
End Sub

--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Karen Brown" wrote in message ...

Hi

I have a macro which i need users of the worksheet to run themselves in
order to update the data validation lists.

My sheet is protected so that they cannot mess around with the
formulas.

Is there any way i can run a macro on a protected sheet without putting
the password in manually?

Any ideas much appreciated.


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/