vba function ( populating rows)

B

Bre-x

Hi,

I would like to create a Function (VBA) that will go to each row take the
TOTALHOURS and acording to
the HOURS/DAY value will enter on each column (DAY) the HOURS/DAY value
until it equeals that value

Example:

WC TOTALHOURS HOURD/DAY 07/02/07 07/03//07 07/04/07
07/05/2007
ABC 10 3 3
3 3 3
ZYS 5 3 3
2
123 10 2 2
2 2 2

Do you think it can be done?

I am trying to create my own Shop Scheduler.

Regards,

Bre-x
 
G

Guest

Assuming total hours (10) appears in C2, Hours/Day is in D2, try this in E2
and copy across and down as far as needed.

=MEDIAN(0,$D2,$C2-((COLUMNS($E2:E2)-1)*$D2))

I'm assuming, for the first item, you want 3 days with 3 hours and one day
with 1 hour (so you don't exceed the total hours), and then 0 hours after the
total has been reached.
 
B

Bre-x

Thank you very much, It works very well.


JMB said:
Assuming total hours (10) appears in C2, Hours/Day is in D2, try this in
E2
and copy across and down as far as needed.

=MEDIAN(0,$D2,$C2-((COLUMNS($E2:E2)-1)*$D2))

I'm assuming, for the first item, you want 3 days with 3 hours and one day
with 1 hour (so you don't exceed the total hours), and then 0 hours after
the
total has been reached.
 

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