Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Chiku
 
Posts: n/a
Default Outlining in Protected Sheet - Attention DP

I have a question about a previous code I saw for maintaining outlines in a
protected worksheet. DP, if you read this, need your help - the code was one
you posted for someone.

Before the code, your wrotes:

If you already have the outline applied, you can protect the worksheet in code
(auto_open/workbook_open??) - What does this mean?

The code is as follows:

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

At the end, you also add that it needs to be reset each time, what too does
that mean?

Two other small questions
1.) - what is the code doing exactly (I just need to understand what it says
in simple terms which helps me understand and change the code if necessary)
2.)And two, everytime I paste it, the "Option Explicit" always pastes
separately. Should I be pasting this under View code on worksheet or
somewhere else? (I admit, my programming knowledge is limited but I can
understand if it's explained)
Thanks in advance.
  #2   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default Outlining in Protected Sheet - Attention DP

It means that you can't do what you want manually. You have to use code to make
it work the way you want.

And this is a setting that excel won't remember tomorrow if you set it today.
You have to reset it each time you open that file.

========
#1. It looks at Sheet1 (change that to match your sheet name). It protects the
sheet using a password--I used "hi", change it to match your password. The
..enableoutlining enables the outlining feature. The .enableautofilter will
enable you to use the filter arrows.

But both of these have to be applied before the code runs--you can't add
data|filter or Data|group with the worksheet protected. You apply those
manually (usually).

#2. This code doesn't go behind a worksheet or behind ThisWorkbook. It goes
into a general module.

Option explicit
is the way developers tell excel that they are going to be declaring every
variable that they use.

That should be used once (per module) and it should appear at the top of the
module.



Chiku wrote:

I have a question about a previous code I saw for maintaining outlines in a
protected worksheet. DP, if you read this, need your help - the code was one
you posted for someone.

Before the code, your wrotes:

If you already have the outline applied, you can protect the worksheet in code
(auto_open/workbook_open??) - What does this mean?

The code is as follows:

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

At the end, you also add that it needs to be reset each time, what too does
that mean?

Two other small questions
1.) - what is the code doing exactly (I just need to understand what it says
in simple terms which helps me understand and change the code if necessary)
2.)And two, everytime I paste it, the "Option Explicit" always pastes
separately. Should I be pasting this under View code on worksheet or
somewhere else? (I admit, my programming knowledge is limited but I can
understand if it's explained)
Thanks in advance.


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
Chiku
 
Posts: n/a
Default Outlining in Protected Sheet - Attention DP

Dave, you explain even technical stuff very well - THANK YOU!!!! At this
rate, I will become a programmer :) Thanks a lot, I will try and avoid doing
programming stuff coz that is how I am getting stuck, but you do explain
things so well that it is easy for non-programmer like me to figure out.
Thank you!!!!


"Dave Peterson" wrote:

It means that you can't do what you want manually. You have to use code to make
it work the way you want.

And this is a setting that excel won't remember tomorrow if you set it today.
You have to reset it each time you open that file.

========
#1. It looks at Sheet1 (change that to match your sheet name). It protects the
sheet using a password--I used "hi", change it to match your password. The
..enableoutlining enables the outlining feature. The .enableautofilter will
enable you to use the filter arrows.

But both of these have to be applied before the code runs--you can't add
data|filter or Data|group with the worksheet protected. You apply those
manually (usually).

#2. This code doesn't go behind a worksheet or behind ThisWorkbook. It goes
into a general module.

Option explicit
is the way developers tell excel that they are going to be declaring every
variable that they use.

That should be used once (per module) and it should appear at the top of the
module.



Chiku wrote:

I have a question about a previous code I saw for maintaining outlines in a
protected worksheet. DP, if you read this, need your help - the code was one
you posted for someone.

Before the code, your wrotes:

If you already have the outline applied, you can protect the worksheet in code
(auto_open/workbook_open??) - What does this mean?

The code is as follows:

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

At the end, you also add that it needs to be reset each time, what too does
that mean?

Two other small questions
1.) - what is the code doing exactly (I just need to understand what it says
in simple terms which helps me understand and change the code if necessary)
2.)And two, everytime I paste it, the "Option Explicit" always pastes
separately. Should I be pasting this under View code on worksheet or
somewhere else? (I admit, my programming knowledge is limited but I can
understand if it's explained)
Thanks in advance.


--

Dave Peterson

  #4   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default Outlining in Protected Sheet - Attention DP

Glad I could help.

But the best way to learn (I think) is to struggle with it. I wouldn't give
up. There's just so much more you can do with a little code that makes life
much easier.

Chiku wrote:

Dave, you explain even technical stuff very well - THANK YOU!!!! At this
rate, I will become a programmer :) Thanks a lot, I will try and avoid doing
programming stuff coz that is how I am getting stuck, but you do explain
things so well that it is easy for non-programmer like me to figure out.
Thank you!!!!

"Dave Peterson" wrote:

It means that you can't do what you want manually. You have to use code to make
it work the way you want.

And this is a setting that excel won't remember tomorrow if you set it today.
You have to reset it each time you open that file.

========
#1. It looks at Sheet1 (change that to match your sheet name). It protects the
sheet using a password--I used "hi", change it to match your password. The
..enableoutlining enables the outlining feature. The .enableautofilter will
enable you to use the filter arrows.

But both of these have to be applied before the code runs--you can't add
data|filter or Data|group with the worksheet protected. You apply those
manually (usually).

#2. This code doesn't go behind a worksheet or behind ThisWorkbook. It goes
into a general module.

Option explicit
is the way developers tell excel that they are going to be declaring every
variable that they use.

That should be used once (per module) and it should appear at the top of the
module.



Chiku wrote:

I have a question about a previous code I saw for maintaining outlines in a
protected worksheet. DP, if you read this, need your help - the code was one
you posted for someone.

Before the code, your wrotes:

If you already have the outline applied, you can protect the worksheet in code
(auto_open/workbook_open??) - What does this mean?

The code is as follows:

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

At the end, you also add that it needs to be reset each time, what too does
that mean?

Two other small questions
1.) - what is the code doing exactly (I just need to understand what it says
in simple terms which helps me understand and change the code if necessary)
2.)And two, everytime I paste it, the "Option Explicit" always pastes
separately. Should I be pasting this under View code on worksheet or
somewhere else? (I admit, my programming knowledge is limited but I can
understand if it's explained)
Thanks in advance.


--

Dave Peterson


--

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
Protected Sheet Message tlosgyl3 Excel Discussion (Misc queries) 2 December 8th 05 09:13 AM
Applying autofilter to protected sheet Brian Ferris Excel Discussion (Misc queries) 2 November 18th 05 05:28 PM
How to copy/paste info into the protected sheet Dajana Excel Discussion (Misc queries) 1 September 21st 05 05:26 PM
Copying multiple sheets from one book 2 another and undertake spec Pank Mehta Excel Discussion (Misc queries) 14 March 16th 05 05:41 PM
Unlock a spinner or scrollbar on a protected sheet kevin99 Excel Worksheet Functions 1 March 14th 05 02:03 PM


All times are GMT +1. The time now is 08:05 AM.

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"