Yomtov,
You can either have a summary custom task field roll-up the values, or
you
can enter it directly, But you can not have both.
A VBA macro is different in that you have to run it when ever you want it
to
recalculate. Custom fields recalculate automatically.
So if you have a macro you would want to rerun it whenever you make a
change.
-Jack
Hi Jack,
OK I am starting to understand why this is designed this way.
What I need is very simple to explain but now I see that it might not
be
so
simple to implement. Maybe you can get me started with a VBA code. I
will
try to explain to the best of my ability.
I would like to have a custom task number field where; when I have a
summary
task with subtasks under it, I would have a choice either to enter the
number
values in the subtasks, and in that case the values would roll up to
the
summary task, or I can enter the value directly in the summary task,
and
then
that value would roll up to a higher summary task.
If you need more specifics I would appreciate if you can let me know
what
those specifics are and I would post it.
Thanks for all,
:
The problem with it is that you have to be able to enter data in the
field.
In project you can either have a field which allows data entry or you
can
have a formula.
You can't have both.
Since you want it to sum up in some cases, you need one field to enter
the
data in
You need another to determine if it rolls up
Then you need another to roll it up.
This is OK when you work with a individual task, but the field that
you
are
trying to roll up can't have a formula. It can only have the condition
that
it be rolled up to the summary.
So I'm afraid you can't get there.
For the VBA, if you specify what you want to happen, I can get you
started
with some sample code.
The better example you can give about how it should calculate, the
better
results you will get here.
-Jack Dahlgren
Hi Jack,
As I don't know VBA, I have no option but to wait if someone here
can
help
and post a code for this. So until that happens I would like to
know
if
you
mind to post your approach. If it ALMOST does what I need maybe
this
will
get me at least a partial solution.
Thanks in advance.
:
Yomtov,
I can think of ways to ALMOST get what you want, but I think the
best
approach will be some VBA.
-Jack Dahlgren
Hi Dean,
Thanks for your suggestions.
Your suggestion will not really work because even though I am
manually
entering the values in this custom field, there are other fields
with
values
that are dependent in this field. So if I work around with your
suggestion
it will affect the other fields.
Thanks
:
If you want to filter for the first subtask, set a flag formula
to
right([Outline Number],2)=".1"
:
It sounds like you are manually entering numbers instead of
setting
a
value
based on other fields in the summary task. If so, a simple
solution
that
isn't quite what you asked for is to customize the field to
rollup
sum,
then
in the first subtask of each summary task, enter the number
that
you
want for
the summary task. This numbers will rollup to all summary
levels.
:
Hi Rod,
Thanks for your reply. I am new to VBA and I don't
completely
comprehend
your question/answer. Why can't the macro star a new
calculation
(from zero)
every time it runs? Almost like the calculation that a Sum
roll
up
does. It
just sums up all the values in this custom field.
:
You need to design a process here. Scenario: 3 levels of
summary
task and
you enter 5 in the custom field for level 2. The macro
runs
and
sums zero
from level 3 to level 2 plus the 5 entered = 5. Level 1
becomes
5.
If you
run the macro again how should the macro treat the two
5's?
If
it
runs as
before the top level becomes 10. Run again it will become
15
and
so
on.
--
Rod Gill
Microsoft MVP for Project
Author of the only book on Project VBA, see:
http://www.projectvbabook.com
message
Hi,
I am looking for a VBA code for a custom number field.
I
am
trying to
create a new number field where I can input numbers in
summary
tasks and
they
would still roll up to higher summary tasks. Is this
possible?
All help is appreciated