LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Password Protect Sheet with formatting allowed

Your welcome

"CER" wrote:

That worked. Thank you for the quick help.

CER

"Mike H" wrote:

Hi,

The line where you apply the password is messing things up, Try this

Range("A:D,S:S").EntireColumn.Hidden = True
ActiveSheet.Protect DrawingObjects:=True, Contents:=True,
Scenarios:= _
True, AllowFormattingColumns:=True, AllowFormattingRows:=True, _
AllowSorting:=True, AllowFiltering:=True,
AllowUsingPivotTables:=True, _
Password:="aaaa"

ActiveSheet.EnableSelection = xlNoRestrictions


Mike
"CER" wrote:

I recorded a macro (don't know enough to write one yet) to hide certain
columns, then password protect the sheet, but allow filtering, sorting, pivot
tables and formatting columns and rows. However, it doesn't check those
options when I run it. Any help is appreciated. Here's the code:

Columns("A:D").Select
Selection.EntireColumn.Hidden = True
ActiveWindow.SmallScroll ToRight:=5
Columns("S:S").Select
Selection.EntireColumn.Hidden = True
ActiveWindow.LargeScroll ToRight:=-2
ActiveSheet.Protect DrawingObjects:=True, Contents:=True,
Scenarios:=True _
, AllowFormattingColumns:=True, AllowFormattingRows:=True,
AllowSorting:= _True, AllowFiltering:=True, AllowUsingPivotTables:=True

ActiveSheet.EnableSelection = xlNoRestrictions
ActiveSheet.Protect Password:="aaaa"

 
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
password protect a sheet Joe Excel Discussion (Misc queries) 5 October 27th 08 11:14 PM
Password Protect a single sheet using VBA Carlee Excel Worksheet Functions 1 September 21st 07 06:33 AM
Protect sheet without password? EllenM Excel Discussion (Misc queries) 2 June 21st 07 03:22 PM
password protect a single sheet stumac Excel Discussion (Misc queries) 0 March 28th 07 12:12 AM
Password Protect a Sheet Lynn Excel Discussion (Misc queries) 1 October 27th 06 03:41 PM


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