Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 14
Default Use Macro to protect choosen sheets in workbook

I have a workbook with 10 sheets, 7 sheets used for Data entry (which I don't
want anyone to be able to change) and 3 for anybody to work with the data on
a day to day basis without them being able to corrupt the original. I know of
the Macro to protect the whole workbook but what I would like is to be able
to protect the 7 Data sheets and leave the 3 working sheets unlocked. Hope
this makes sense to you.
Thx in advance
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Use Macro to protect choosen sheets in workbook

Maybe something like:

Option Explicit
Sub testme()

Dim myPWD As String
Dim wks As Worksheet

myPWD = "TopSeCrET"

For Each wks In ActiveWorkbook.Worksheets
Select Case LCase(wks.Name)
'make sure you use lower case when you change these!
Case Is = "sheet1", "sheet2", "sheet5", "sheet99", _
"sheet100", "another sheet", "and one more", "lastone"
wks.Protect Password:=myPWD
Case Else
'do nothing
End Select
Next wks
End Sub


kevhatch wrote:

I have a workbook with 10 sheets, 7 sheets used for Data entry (which I don't
want anyone to be able to change) and 3 for anybody to work with the data on
a day to day basis without them being able to corrupt the original. I know of
the Macro to protect the whole workbook but what I would like is to be able
to protect the 7 Data sheets and leave the 3 working sheets unlocked. Hope
this makes sense to you.
Thx in advance


--

Dave Peterson
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
how do I email amacro? leo Excel Worksheet Functions 24 August 9th 06 02:47 PM
Protect Workbook vs Worksheet?? Dan B Excel Worksheet Functions 3 November 7th 05 09:02 PM
VBA Code To have a macro repeat on all sheets in a workbook carl Excel Worksheet Functions 3 November 3rd 05 07:48 PM
Macro to link Sheets to main workbook raven_guy Excel Discussion (Misc queries) 0 June 24th 05 12:36 PM
Playing a macro from another workbook Jim Excel Discussion (Misc queries) 1 February 23rd 05 10:12 PM


All times are GMT +1. The time now is 02:27 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"