Help with custom fields

Y

yomtov

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
 
R

Rod Gill

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
 
Y

yomtov

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.
 
D

Dean C

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.
 
D

Dean C

If you want to filter for the first subtask, set a flag formula to
right([Outline Number],2)=".1"
 
Y

yomtov

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

Dean C said:
If you want to filter for the first subtask, set a flag formula to
right([Outline Number],2)=".1"

Dean C said:
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.
 
J

Jack Dahlgren MVP

Yomtov,

I can think of ways to ALMOST get what you want, but I think the best
approach will be some VBA.

-Jack Dahlgren


yomtov said:
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

Dean C said:
If you want to filter for the first subtask, set a flag formula to
right([Outline Number],2)=".1"

Dean C said:
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



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
 
Y

yomtov

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.

Jack Dahlgren MVP said:
Yomtov,

I can think of ways to ALMOST get what you want, but I think the best
approach will be some VBA.

-Jack Dahlgren


yomtov said:
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

Dean C said:
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



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
 
D

Dean C

I don't understand your concern. For a summary task, the value that is in the
field should be the same as if it were manually entered. Other fields in the
summary task that depend on that value should calculate normally. If you use
that same field for non-summary tasks, then I understand your concern and
would use a different field than one used by non-summary tasks.

yomtov said:
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

Dean C said:
If you want to filter for the first subtask, set a flag formula to
right([Outline Number],2)=".1"

Dean C said:
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



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
 
Y

yomtov

Hi Dean,

I am not concerned for the other fields in the summary task that will be
affected by this value. On the contrary this is the outcome I want. My
concern is that the value that I will enter on that first subtask will affect
that subtasks' other fields, since this is values that I only want in summary
task but I am entering it in a subtask so it is reflected in the summary task
when it rolls up.

Thanks

Dean C said:
I don't understand your concern. For a summary task, the value that is in the
field should be the same as if it were manually entered. Other fields in the
summary task that depend on that value should calculate normally. If you use
that same field for non-summary tasks, then I understand your concern and
would use a different field than one used by non-summary tasks.

yomtov said:
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

Dean C said:
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



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
 
D

Dean C

Based on the scenario you described, only summary tasks should use the value
in this field for other calculations, so all fields referring to this field
check to determine whether the current task is a summary task, add the code
below before any reference to the field, followed by your calculation using
this field, then the calculation for non-summary tasks.
IIf([Summary]=True,


yomtov said:
Hi Dean,

I am not concerned for the other fields in the summary task that will be
affected by this value. On the contrary this is the outcome I want. My
concern is that the value that I will enter on that first subtask will affect
that subtasks' other fields, since this is values that I only want in summary
task but I am entering it in a subtask so it is reflected in the summary task
when it rolls up.

Thanks

Dean C said:
I don't understand your concern. For a summary task, the value that is in the
field should be the same as if it were manually entered. Other fields in the
summary task that depend on that value should calculate normally. If you use
that same field for non-summary tasks, then I understand your concern and
would use a different field than one used by non-summary tasks.

yomtov said:
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



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
 
Y

yomtov

Hi Dean,

Now I understand our misunderstanding. I do want to be able to enter values
in non summary tasks too, and those values should calculate other fields. I
just want to be able to sometimes enter values directly and exclusively in
summary tasks. That is the reason this will not work because I cannot
exclude all non summary tasks as sometimes I do need those values there.

Thanks for trying to help me.

Dean C said:
Based on the scenario you described, only summary tasks should use the value
in this field for other calculations, so all fields referring to this field
check to determine whether the current task is a summary task, add the code
below before any reference to the field, followed by your calculation using
this field, then the calculation for non-summary tasks.
IIf([Summary]=True,


yomtov said:
Hi Dean,

I am not concerned for the other fields in the summary task that will be
affected by this value. On the contrary this is the outcome I want. My
concern is that the value that I will enter on that first subtask will affect
that subtasks' other fields, since this is values that I only want in summary
task but I am entering it in a subtask so it is reflected in the summary task
when it rolls up.

Thanks

Dean C said:
I don't understand your concern. For a summary task, the value that is in the
field should be the same as if it were manually entered. Other fields in the
summary task that depend on that value should calculate normally. If you use
that same field for non-summary tasks, then I understand your concern and
would use a different field than one used by non-summary tasks.

:

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



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
 
J

Jack Dahlgren MVP

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


yomtov said:
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.

Jack Dahlgren MVP said:
Yomtov,

I can think of ways to ALMOST get what you want, but I think the best
approach will be some VBA.

-Jack Dahlgren


yomtov said:
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



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
 
Y

yomtov

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,


Jack Dahlgren MVP said:
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


yomtov said:
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.

Jack Dahlgren MVP said:
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



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
 
D

Dean C

The solution to your problem is to use two fields if you want to replace the
sum of the subtasks with a value for the summary task. If you want to add a
value for summary tasks to the subtotal of the tasks below, add a dummy task
whose only purpose is to add to the summary task. You may need to set a flag
for dummy tasks so that other fields can check to see whether to use the
value in the field you're worried about.

yomtov said:
Hi Dean,

Now I understand our misunderstanding. I do want to be able to enter values
in non summary tasks too, and those values should calculate other fields. I
just want to be able to sometimes enter values directly and exclusively in
summary tasks. That is the reason this will not work because I cannot
exclude all non summary tasks as sometimes I do need those values there.

Thanks for trying to help me.

Dean C said:
Based on the scenario you described, only summary tasks should use the value
in this field for other calculations, so all fields referring to this field
check to determine whether the current task is a summary task, add the code
below before any reference to the field, followed by your calculation using
this field, then the calculation for non-summary tasks.
IIf([Summary]=True,


yomtov said:
Hi Dean,

I am not concerned for the other fields in the summary task that will be
affected by this value. On the contrary this is the outcome I want. My
concern is that the value that I will enter on that first subtask will affect
that subtasks' other fields, since this is values that I only want in summary
task but I am entering it in a subtask so it is reflected in the summary task
when it rolls up.

Thanks

:

I don't understand your concern. For a summary task, the value that is in the
field should be the same as if it were manually entered. Other fields in the
summary task that depend on that value should calculate normally. If you use
that same field for non-summary tasks, then I understand your concern and
would use a different field than one used by non-summary tasks.

:

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



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
 
J

Jack Dahlgren MVP

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


yomtov said:
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,


Jack Dahlgren MVP said:
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


yomtov said:
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



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
 
Y

yomtov

Hi Jack,

I understand that with a macro I would have to rerun every time I want to
update my calculations and I am fine with it. But how and where can i get
such a macro?

All help is appreciated.

Jack Dahlgren MVP said:
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


yomtov said:
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,


Jack Dahlgren MVP said:
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



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
 
Y

yomtov

Hi Dean,

Thanks! This works very good.



Dean C said:
The solution to your problem is to use two fields if you want to replace the
sum of the subtasks with a value for the summary task. If you want to add a
value for summary tasks to the subtotal of the tasks below, add a dummy task
whose only purpose is to add to the summary task. You may need to set a flag
for dummy tasks so that other fields can check to see whether to use the
value in the field you're worried about.

yomtov said:
Hi Dean,

Now I understand our misunderstanding. I do want to be able to enter values
in non summary tasks too, and those values should calculate other fields. I
just want to be able to sometimes enter values directly and exclusively in
summary tasks. That is the reason this will not work because I cannot
exclude all non summary tasks as sometimes I do need those values there.

Thanks for trying to help me.

Dean C said:
Based on the scenario you described, only summary tasks should use the value
in this field for other calculations, so all fields referring to this field
check to determine whether the current task is a summary task, add the code
below before any reference to the field, followed by your calculation using
this field, then the calculation for non-summary tasks.
IIf([Summary]=True,


:

Hi Dean,

I am not concerned for the other fields in the summary task that will be
affected by this value. On the contrary this is the outcome I want. My
concern is that the value that I will enter on that first subtask will affect
that subtasks' other fields, since this is values that I only want in summary
task but I am entering it in a subtask so it is reflected in the summary task
when it rolls up.

Thanks

:

I don't understand your concern. For a summary task, the value that is in the
field should be the same as if it were manually entered. Other fields in the
summary task that depend on that value should calculate normally. If you use
that same field for non-summary tasks, then I understand your concern and
would use a different field than one used by non-summary tasks.

:

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



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
 
J

Jack Dahlgren MVP

Take a look at my macro pages here:
http://masamiki.com/project/macros.htm
particularly the Summary Name macro part way down the page.
What you are looking for is something similar but in reverse.
I also have some basics here:
http://zo-d.com/blog/archives/programming.html

I'd write up something for you but I don't have any spare time right now.

-Jack

yomtov said:
Hi Jack,

I understand that with a macro I would have to rerun every time I want to
update my calculations and I am fine with it. But how and where can i get
such a macro?

All help is appreciated.

Jack Dahlgren MVP said:
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


yomtov said:
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
 
Y

yomtov

Thank you

Jack Dahlgren MVP said:
Take a look at my macro pages here:
http://masamiki.com/project/macros.htm
particularly the Summary Name macro part way down the page.
What you are looking for is something similar but in reverse.
I also have some basics here:
http://zo-d.com/blog/archives/programming.html

I'd write up something for you but I don't have any spare time right now.

-Jack

yomtov said:
Hi Jack,

I understand that with a macro I would have to rerun every time I want to
update my calculations and I am fine with it. But how and where can i get
such a macro?

All help is appreciated.

Jack Dahlgren MVP said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top