K Dale,
Thanks for the input. I'm definitely quite a ways from "in the end it'll
all come together." ha! Thanks for the info and the encouragement.
Randy
"K Dales" wrote:
> You need to think of VB as instructions rather than a function that gives a
> result (of course you can build a function out of VB instructions).
>
> In VB code you make a basic IF statement:
> IF Condition THEN...
>
> Now you can think of Condition as one condition or as a combination of
> several (that in the end give either a true/false result). If several you
> would write
>
> IF condition1 AND/OR condition2 AND/OR condition3 AND/OR condition 4 ...
>
> The order of the conditions is important since you can come to different
> results depending on how it is interpreted; for example
> True OR False AND False
> could be interpreted as either (True AND False) OR False, which would be
> False, or as True OR (False AND False), which is True. VB will evaluate left
> to right unless directed otherwise by brackets (it will do whatever is inside
> the innermost brackets first). Whenever there is potential for confusion -
> even my own confusion, not VB's! - I use brackets to make my intentions clear.
>
> So, in the end, I might write:
>
> IF ((Range("A1").Value = 100) AND ((Range("B1").Value<=Date) OR
> (Range("C1").Value=True)) Then...
>
> My response should show that VB is conceptually very different from
> worksheet functions; VB works in discrete and very detailed steps where you
> need to assemble the pieces, whereas worksheet functions do most of the work
> for you if you only know how to supply the parameters. For that reason I am
> doubtful any reference exists that tries to go from one to the other; I think
> you would do better learning VB from scratch (there are many references
> available), without thinking about worksheet functions yet. In the end it
> all comes together.
> --
> - K Dales
>
>
> "RAP" wrote:
>
> > Hello, Folks
> >
> > I'm fairly adept at developing answers to my problems using worksheet
> > functions as long as they're entered into cells. Getting the same
> > functionality while using VB is a whole new ball of wax for me. Is there an
> > on-line reference you can recommend for this? My reference books simply do
> > not address my needs.
> >
> > Ex: How do I write VB script to nest the AND and IF worksheet functions?
> >
> > Thank you,
> > Randy
Bookmarks