LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 155
Default Protecting whole workbook

Hi,
I have a workbook with approx 30 worksheets and have protected each
worksheet with the following macro's

Private Sub Protect_Workbook_Click()
'Protect workbook
Dim ws As Worksheet
Application.ScreenUpdating = False
For Each ws In ActiveWorkbook.Worksheets
If ws.ProtectContents = False Then
ws.Protect ("BBHS")
End If
Next
ActiveWorkbook.Protect (["BBHS"])
Application.ScreenUpdating = True


End Sub

Private Sub UnProtect_Workbook_Click()
'Unprotect workbook
Dim ws As Worksheet
Application.ScreenUpdating = False
For Each ws In ActiveWorkbook.Worksheets
If ws.ProtectContents = True Then
ws.Unprotect ("BBHS")
End If
Next
ActiveWorkbook.Unprotect (["BBHS"])
Application.ScreenUpdating = True


End Sub

What I am finding is after I run the protection macro is each worksheet
allows you still to click in every cell. My question is, how do get the
macro to protect the worksheets in such a way that you can only click on a
cell that is unprotected?
If anyone could help with this I would be appreciate it greatly.
Regards
Tanya


 
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
Protecting a workbook Kim Excel Worksheet Functions 5 September 29th 08 06:26 PM
protecting workbook jolowe Excel Discussion (Misc queries) 2 June 8th 08 02:57 PM
Protecting a workbook Sasikiran Excel Discussion (Misc queries) 1 March 6th 08 10:05 PM
Protecting a workbook Oldjay Excel Discussion (Misc queries) 1 February 24th 08 08:40 PM
Protecting Workbook!.. Neo1 Excel Worksheet Functions 3 May 3rd 06 01:22 PM


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

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

About Us

"It's about Microsoft Excel"