ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   vba function ( populating rows) (https://www.excelbanter.com/excel-discussion-misc-queries/149860-vba-function-populating-rows.html)

Bre-x

vba function ( populating rows)
 
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




JMB

vba function ( populating rows)
 
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.


"Bre-x" wrote:

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





Bre-x

vba function ( populating rows)
 
Thank you very much, It works very well.


"JMB" wrote in message
...
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.


"Bre-x" wrote:

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







JMB

vba function ( populating rows)
 
Quite welcome.

"Bre-x" wrote:

Thank you very much, It works very well.


"JMB" wrote in message
...
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.


"Bre-x" wrote:

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









All times are GMT +1. The time now is 02:51 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com