Thanks Steve. I did some more on this through the early hours...
I hear you in that I just have to loop through the array to find an
element
which confirms that neither Join or Match works in Project VBA.
What I am trying to do is summarise all the task assignments for a given
deliverable/work package. Task 1 may have "A" and "B assigned, Task 2 may
also have "A" assigned, Task 3 may have "C" assigned.
The top level logic of course is to loop through all the tasks then loop
through all the assignments.
I am thinking that I would store all the assignment values for a
deliverable
in an array, however I don't know the size of the array until I get to the
last task for the deliverable.
For Task 1, that is easy redefine the array of size 2 (in this example);
Task 2, loop through find "A" and store the required values; Task 3 finds
a
new assignment which I then need to add to the array but it has already
been
defined.
I am thinking I could risk using the "preserve" keyword and redefine the
array again, or go through all the tasks for a deliverable, once to find
the
total assignments, and second, to store the values, which slows things
down.
That is the extent of my problem.
Thanks and regards
Michael A.
Steve said:
If you define that element as the index of the array, then you can just
refer to array["B"]. Of course, that assumes that there will only be one
"B".
If you truly want "B" to be the value and may store multiple entries of
it
in the array, then you have to search for it, and that means looping
through
the array.
HTH
Hello,
Does anyone know how I could search for an element within a string
array?
I
have Rod Gill's book - he mentions just splitting strings. If I have
an
array containing ("A" "B" "C" "D") and I want to find "B" without
having
to
always use a for loop.
I have tried using Join and xlapp.worksheetfunction.match both of which
returns a compiling error.
Thanks
Michael Andersen