Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Gord Dibben
 
Posts: n/a
Default some 'Protection' questions

Bri

Paul has addressed a)

b) unprotect the sheet, run your code then re-protect.

Sub SHEETUNPROTECT()
ActiveSheet.Unprotect Password:="justme"

'your code goes here

ActiveSheet.Protect Password:="justme"
End Sub

c)To highlight all locked cells....................

Sub Locked_Cells()
Dim cell As Range, tempR As Range, rangeToCheck As Range
'check each cell in the selection
For Each cell In Intersect(Selection, ActiveSheet.UsedRange)
If cell.Locked Then
If tempR Is Nothing Then
'initialize tempR with the first qualifying cell
Set tempR = cell
Else
'add additional cells to tempR
Set tempR = Union(tempR, cell)
End If
End If
Next cell
'display message and stop if no cells found
If tempR Is Nothing Then
MsgBox "There are no Locked cells " & _
"in the selected range."
End
End If
'select qualifying cells
tempR.Interior.ColorIndex = 3
End Sub

d) No way to prevent deletion of a file unless you have exclusive permissions
for the folder in which the file is stored.

See Windows Help and Support for "permissions". Be very careful with
this.........you could lock yourselef out.


Gord Dibben MS Excel MVP

On Tue, 24 Jan 2006 16:49:17 -0500, "Bri" wrote:

Hello

I have a workbook nearing completion and I'm now adding (well, attempting)
protection. I have some questions:

a) Each worksheet has regions of unlocked cells, the others being locked.
I can protect each work sheet one-by-one. Is there a way to protect them
all at once? (Selecting all tabs leaves ToolsProtectionProtect Sheet ...
grayed out.)

b) My worksheets contain macros that either hide or show columns using Subs
with code fragments like 'Columns(N).Hidden = False'. When a worksheet is
protected with the default 'select locked cells' and 'select unlocked
cells' checked, I can't run the macros. If I also check the 'format
columns' protection option, the macros work properly, but the user can alter
column widths (undesirable). Is there an easy solution?

c) I have many worksheets with several regions either locked or unlocked.
Is there an easy way to show the locked status of each cell without having
to check each one individually?

d) I think this one is really dumb, but here goes. I took a test excel
file and fully protected each sheet and the entire workbook (both structure
and windows). As expected, I couldn't really do anything after that, but I
could go into explorer and erase the entire file. Is this easily
preventable?

Much thanks
Bri








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
VBA code error with Protection turned on - help please Fred Excel Discussion (Misc queries) 1 March 17th 06 04:06 PM
Illinois Personal Information Protection Act [email protected] Excel Worksheet Functions 0 August 16th 05 03:15 AM
Pivot Table for survey data w/ questions as Rows & poss answrs as pfwebadmin Excel Discussion (Misc queries) 0 May 17th 05 02:31 PM
workbook protection John New Users to Excel 1 January 22nd 05 12:55 PM
protection on excel forms cben Excel Worksheet Functions 1 December 14th 04 02:23 PM


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