Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 29
Default Protect a sheet but allow columns to unhide

Hi there,
I'm a bit stumped! I have got a sheet in Excel that needs to be protected.
However, I have grouped certain columns using the Group Outline tool which
have the "+" symbol at the top of the sheet. I would like the sheet to be
completely protected, but allow the hidden sheets to hide and unhide when the
"+" and "-" are clicked. Can anyone help?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Protect a sheet but allow columns to unhide

If you already have the outline/subtotals/autofilter applied, you can protect
the worksheet in code (auto_open/workbook_open??).

Option Explicit
Sub auto_open()
With Worksheets("sheet1")
.Protect Password:="hi", userinterfaceonly:=True
.EnableOutlining = True
'.EnableAutoFilter = True
'If .FilterMode Then
' .ShowAllData
'End If
End With
End Sub

It needs to be reset each time you open the workbook. (Earlier versions of
excel don't remember it after closing the workbook. IIRC, xl2002+ will remember
the allow autofilter setting under tools|Protection|protect sheet, but that
won't help when you're filtering via code.)

If you're new to macros:

Debra Dalgleish has some notes how to implement macros he
http://www.contextures.com/xlvba01.html

David McRitchie has an intro to macros:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

Ron de Bruin's intro to macros:
http://www.rondebruin.nl/code.htm

(General, Regular and Standard modules all describe the same thing.)

Plum wrote:

Hi there,
I'm a bit stumped! I have got a sheet in Excel that needs to be protected.
However, I have grouped certain columns using the Group Outline tool which
have the "+" symbol at the top of the sheet. I would like the sheet to be
completely protected, but allow the hidden sheets to hide and unhide when the
"+" and "-" are clicked. Can anyone help?


--

Dave Peterson
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
Hide/Unhide after protect sheet RKS Excel Discussion (Misc queries) 0 March 21st 08 05:03 AM
Need to password protect work sheet and unhide rows. Nicholas Excel Discussion (Misc queries) 2 October 5th 07 06:44 PM
Can I protect columns w/in a "List" using Protect Sheet? Diane Excel Discussion (Misc queries) 0 May 10th 06 03:30 PM
unhide columns a-c on spread sheet SKY Setting up and Configuration of Excel 3 April 8th 06 09:23 PM
Protect sheet and allow grouping of columns Job Excel Worksheet Functions 2 May 6th 05 01:44 PM


All times are GMT +1. The time now is 07:54 PM.

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"