Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Outlines and Locked Worksheet: XL97
Hi There,
I have underneath sub to protect my locked cells ... Standing on a locked cell prevents me to use (click) my outlines (XL97!). OK, I understand that it does ...what it does! But maybe there is a workaround? Best Regards Sige Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range) If Target.Locked = True Then Me.Protect Password:="" Else Me.Unprotect Password:="" End If End Sub |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Outlines and Locked Worksheet: XL97
If you already have the outline 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 End With End Sub (I wasn't sure what caused your outlining--data|Group or Data|subtotals).) It needs to be reset each time you open the workbook. (excel doesn't remember it after closing the workbook.) If you're new to macros, you may want to read David McRitchie's intro at: http://www.mvps.org/dmcritchie/excel/getstarted.htm Sige wrote: Hi There, I have underneath sub to protect my locked cells ... Standing on a locked cell prevents me to use (click) my outlines (XL97!). OK, I understand that it does ...what it does! But maybe there is a workaround? Best Regards Sige Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range) If Target.Locked = True Then Me.Protect Password:="" Else Me.Unprotect Password:="" End If End Sub -- Dave Peterson |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Outlines and Locked Worksheet: XL97
.EnableOutlining = True
Thx Dave! Dave Peterson wrote: If you already have the outline 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 End With End Sub (I wasn't sure what caused your outlining--data|Group or Data|subtotals).) It needs to be reset each time you open the workbook. (excel doesn't remember it after closing the workbook.) If you're new to macros, you may want to read David McRitchie's intro at: http://www.mvps.org/dmcritchie/excel/getstarted.htm Sige wrote: Hi There, I have underneath sub to protect my locked cells ... Standing on a locked cell prevents me to use (click) my outlines (XL97!). OK, I understand that it does ...what it does! But maybe there is a workaround? Best Regards Sige Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range) If Target.Locked = True Then Me.Protect Password:="" Else Me.Unprotect Password:="" End If End Sub -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Locked worksheet & hyperlinks (w/ select locked cells unchecked) | Excel Discussion (Misc queries) | |||
worksheet protection and outlines | Excel Worksheet Functions | |||
Protected worksheet and Outlines | Excel Programming | |||
Editing Custom Worksheet Menu Bar in XL97 & Associtated Macros | Excel Programming | |||
strange worksheet.codenames in XL97 | Excel Programming |