Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 788
Default Macro to Protect Mult Sheets / but allow Pivot Tables...

Hello Group,

I have this code that i found in searching the forums, but i have a
question. I need to allow them to access two unlocked cells and a
pre-exsisting pivot table. I want to lock the rest of the sheet. Can someone
else me improve this code please? :)

Sub LockEm()
Dim i As Long
Dim PW As String
Dim WS As Worksheet
PW = InputBox("Password:")
On Error GoTo MyErr
For Each WS In ActiveWorkbook.Worksheets
WS.Protect (PW)
Next
MsgBox i & " errors while protecting", vbInformation
Exit Sub
MyErr:
i = i + 1
Resume Next
End Sub

Thank you.
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pivot tables and work sheets oakley Excel Worksheet Functions 2 May 24th 07 09:54 AM
Macro to protect multiple sheets? Stilla Excel Worksheet Functions 12 March 5th 07 07:03 PM
Use Macro to protect choosen sheets in workbook kevhatch Excel Discussion (Misc queries) 1 January 27th 07 06:52 PM
#REF in Sheets that refer to Pivot Tables Will C. Excel Discussion (Misc queries) 1 June 2nd 06 08:54 PM
Copying sheets with pivot tables mnirula Excel Worksheet Functions 0 March 1st 05 01:47 AM


All times are GMT +1. The time now is 06:06 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"