Need VBA Code To Calculate Hours

July 25, 2017 at 10:10:29
Specs: Windows 7
hi

I would like a macro where I have an amount of hours of 459.50 in column B and FTE 12.25 in column C. FTE is calculated by 459.50/37.5.

I want a list to be created per staff showing 37.5 in column B on all the lines and 1 in column C in all the lines until 37.50* 1 = 459.50. There will be 12 staff at 1 FTE and 1 staff at 0.25. so 13 staff in total.

Please can someone help in creating a code.

many thanks


See More: Need VBA Code To Calculate Hours

Reply ↓  Report •

#1
July 26, 2017 at 06:06:27
Allow me to start with a posting tip:

When posting in a Help forum such as this, please try to use a Subject Line that tells us something about your question. If everyone used a generic Subject Line such as "VBA - Macro Code" we wouldn't be able to tell one question from another and the Archives would essentially be useless.

I have edited the subject line of your post to show you what I mean. Please scan the list of questions in this forum to see the types of Subject Lines that others have used. Thanks for understanding.

As far as your question, I'm a bit confused.

First you said "I have an amount of hours of 459.50 in column B"

Then you said: "I want a list to be created per staff showing 37.5 in column B"

You can't have a "number of hours" and 37.5 in the same column at the same time.

You also said: "...and 1 in column C in all the lines until 37.50* 1 = 459.50."

37.50*1 will never, ever equal 459.50.

Finally, you said: "There will be 12 staff at 1 FTE and 1 staff at 0.25. so 13 staff in total."

I have no idea what we are supposed to do with this information.

Please keep in mind that we cannot see your workbook from where we are sitting nor do we understand your process the way you do. We are going to need a clearer explanation of your requirements before we can help. Perhaps a short example of your actual data (with all personal/confidential information removed) would help.

If you are going to post example data, please click on the following link and read the instructions on how to post example data in this forum.

Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.


Reply ↓  Report •
Related Solutions


Ask Question