On Feb 17, 10:17 am, Don Wiss <donwiss@no_spam.com> wrote:
> On Sun, 17 Feb 2008 05:54:23 -0800 (PST), SteveM <sbm...@vzavenue.net>
> wrote:
>
> >I think this should do it:
>
> >Public Function ProtectStatus() As String
> > Dim pStatus As Boolean
>
> > pStatus = ActiveSheet.Protect
> > If pStatus = True Then
> > ProtectStatus = "Protected"
> > Else
> > ProtectStatus = "Unprotected"
> > End If
>
> >End Function
>
> Why all the unnecessary code? Why not?
>
> Public Function ProtectStatus() As String
>
> If ActiveSheet.Protect Then
> ProtectStatus = "Protected"
> Else
> ProtectStatus = "Unprotected"
> End If
>
> End Function
>
> And you never need code like "pStatus = True" as pStatus is already a
> boolean.
>
> Don <www.donwiss.com> (e-mail link at home page bottom).
I suppose I could say that:
I wanted the logic to be clear to the OP. Or;
I just like the way "True" looks on a page. Or;
We haven't gotten that far yet in the Programming with Prussian
Efficiency course I'm taking. Or even;
I'm just a dope.
There may others. Take your pick.
SteveM
|