Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 206
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 206
Default 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
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
Locked worksheet & hyperlinks (w/ select locked cells unchecked) dgold82 Excel Discussion (Misc queries) 1 July 10th 09 09:42 PM
worksheet protection and outlines Des77 Excel Worksheet Functions 0 September 22nd 05 07:23 PM
Protected worksheet and Outlines Vlado Sveda[_2_] Excel Programming 4 May 23rd 05 06:13 PM
Editing Custom Worksheet Menu Bar in XL97 & Associtated Macros windsurferLA[_3_] Excel Programming 5 December 29th 04 12:55 AM
strange worksheet.codenames in XL97 Arne[_2_] Excel Programming 0 July 28th 03 03:35 PM


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