A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

protection indicator



 
 
Thread Tools Display Modes
  #1  
Old March 6th, 2010, 12:11 PM posted to microsoft.public.excel.worksheet.functions
Nader
external usenet poster
 
Posts: 48
Default protection indicator

Hi
I write two question a bout this but no answer
pleas, if possible I want a function that if worksheet protected write a
text in a cell
like "protected" if not protected, write "unprotected".
kind regards
nader
  #2  
Old March 7th, 2010, 12:40 PM posted to microsoft.public.excel.worksheet.functions
Satti Charvak
external usenet poster
 
Posts: 37
Default protection indicator

You can use the following sample macro code

Sub SetProtection()

Range("A1").Formula = "1"
Range("B1").Formula = "3"
Range("C1").Formula = "4"
ActiveSheet.Protect

' Check the protection setting of the worksheet and act accordingly.
If ActiveSheet.Protection.AllowInsertingColumns = False Then
ActiveSheet.Protect AllowInsertingColumns:=True
MsgBox "Insert a column between 1 and 3"
Else
MsgBox "Insert a column between 1 and 3"
End If

End Sub


You can use the following protection properties:
AllowDeletingColumns
AllowDeletingRows
AllowFiltering
AllowFormattingCells
AllowFormattingColumns
AllowFormattingRows
AllowInsertingColumns
AllowInsertingHyperlinks
AllowInsertingRows
AllowSorting
AllowUsingPivotTables


--
Kind Regards,
Satti Charvak
Only an Excel Enthusiast


"nader" wrote:

Hi
I write two question a bout this but no answer
pleas, if possible I want a function that if worksheet protected write a
text in a cell
like "protected" if not protected, write "unprotected".
kind regards
nader

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


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


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