Yep, exactly. A more "pedestrian" way for the same result could be an "If
... Else... End If":
With ActiveWindow.View
If .ShowRevisionsAndComments = True Then
.ShowRevisionsAndComments = False
Else
.ShowRevisionsAndComments = True
End If
(BTW, "If .ShowRevisionsAndComments = True Then" is the same as "If
.ShowRevisionsAndComments Then")
Regards,
Klaus
Very interesting. Thanks for the lesson. I've tried learning VBA from a
couple books, but that isn't a practical way to learn, at least not for me.
Digging in, making mistakes, and asking for help -- and getting great advice
like yours -- seems to be the only way I'm going to understand VBA.
I appreciate your help.
pjs
> Yep, exactly. A more "pedestrian" way for the same result could be an "If
> .... Else... End If":
[quoted text clipped - 26 lines]
> >
> > pjs
Klaus Linke - 25 Mar 2008 22:50 GMT
> [...] -- seems to be the only way I'm going to understand VBA.
It's not made simpler by the fact that you need a smattering of knowledge
about boolean algebra on top of it, in this case.
Boolean algebra is calculating with variables that can only take two values,
often denoted as "True" and "False".
In "If [expression] then...", the [expression] has to be something that
evaluates as either "True" or as "False".
"If [expression] = True Then"
is the same as
"If [expression] Then"
because there are two possible values for [expression] ...
In case [expression] is True then "[expression] = True" is True because
"(True = True)" evaluates to "True".
In case [expression] is False then "[expression] = True" is False because
"(False = True)" evaluates to "False".
The Not operator in front of any expression turns its value into the other
value:
Not [expression] is ...
... False if [expression] is True
... True if [expression] is False
Greetings,
Klaus