Re: Outlining in Protected Sheet - Attention DP

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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
>
.



Relevant Pages

  • Re: expanding or collapsing groupings in protected worksheets
    ... Dave, can you give me line by line instructions on how and where to apply ... the worksheet in code. ... .EnableOutlining = True ... I have a protected worksheet which I share with managers. ...
    (microsoft.public.excel.misc)
  • Re: Print Variables ?
    ... Thank you Dave. ... because I am using a cell, the code needs to know what cell is available ... worksheet, thus destroying the PrintArea already established for the worksheet ...
    (microsoft.public.excel.programming)
  • Re: user interaction to select a sheet
    ... In my specific situation, I think programming it ... to get the worksheet that owns that range: ... on error goto 0 ... I would like the user to be able to click on a cell in a sheet to tell the ...
    (microsoft.public.excel.programming)
  • Re: explanation of codes in Visual Basic when creating User form
    ... For example, looking up "Dim" will give you the syntax of Dim with its minimum and optional parts, and a few examples. ... means you defined a variable named "ws" as a Worksheet. ... If you have any background in programming -- and in particular object-oriented programming -- you can stumble your way through most Excel programming just by recording Macros and looking at the resulting code, supplmented with a healthy dose of the help files. ...
    (microsoft.public.excel.newusers)
  • Re: explanation of codes in Visual Basic when creating User form
    ... most of the terms is available in the help files within the Visual Basic ... looking up "Dim" will give you the syntax of Dim with ... means you defined a variable named "ws" as a Worksheet. ... If you have any background in programming -- and in particular ...
    (microsoft.public.excel.newusers)