Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 61
Default Macro protected work sheet

Hi All,

I've use macro to protect the sheet with the group function work, as follow:

Sub Auto_Open()
With Worksheets("Sheet1")
.Protect Password:="hi", userinterfaceonly:=True
.EnableOutlining = True
End With
End Sub

It works fine, but i would like to enable the hide/unhide and insert/delete
rows & columns function. ie, the "Protect Sheet" dialog box should be all
checked instead of "Select locked cells" and "Select unlocked cells" be
checked only. How can i do that except manually unprotect the sheet and
protect it back again?

Also, could this macro runs on multiple sheet? if i create a copy of sheet1
could it works on "sheet1 (2)" automatically?

Seems i asked too much...but thanks for your help!!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 770
Default Macro protected work sheet

Henry,

I turned on the Macro Recorder, protected a sheet and checked all the boxes.
This is what I got:

ActiveSheet.Protect DrawingObjects:=False, Contents:=True, Scenarios:= _
False, AllowFormattingCells:=True, AllowFormattingColumns:=True, _
AllowFormattingRows:=True, AllowInsertingColumns:=True,
AllowInsertingRows _
:=True, AllowInsertingHyperlinks:=True, AllowDeletingColumns:=True,
_
AllowDeletingRows:=True, AllowSorting:=True, AllowFiltering:=True, _
AllowUsingPivotTables:=True

I'm 99.9% sure that the protection will copy over if you make a copy of the
sheet after you do this. I guess you'll know for sure when you try it!

hth,

Doug

"Henry" wrote in message
...
Hi All,

I've use macro to protect the sheet with the group function work, as

follow:

Sub Auto_Open()
With Worksheets("Sheet1")
.Protect Password:="hi", userinterfaceonly:=True
.EnableOutlining = True
End With
End Sub

It works fine, but i would like to enable the hide/unhide and

insert/delete
rows & columns function. ie, the "Protect Sheet" dialog box should be all
checked instead of "Select locked cells" and "Select unlocked cells" be
checked only. How can i do that except manually unprotect the sheet and
protect it back again?

Also, could this macro runs on multiple sheet? if i create a copy of

sheet1
could it works on "sheet1 (2)" automatically?

Seems i asked too much...but thanks for your help!!



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
Hyperlinks on protected sheet don't work Horatio J. Bilge, Jr. Excel Discussion (Misc queries) 0 April 24th 09 07:19 PM
UDF doesn't work on a protected sheet in Excel 2003 CarpeDiem Excel Discussion (Misc queries) 0 February 10th 09 08:13 PM
protected work sheet jinge Excel Discussion (Misc queries) 1 December 27th 08 10:29 PM
Find doesn't work if the sheet is protected ON Excel Discussion (Misc queries) 1 June 12th 08 03:49 PM
Protected work sheet Stuart Carnachan Excel Discussion (Misc queries) 0 August 30th 06 03:48 PM


All times are GMT +1. The time now is 02:24 AM.

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"