Hi
I'm struggling a bit to understand how this works (i.e. which bits above are the errors and which bits are your desired result), but my thoughts are:-
This looks suspicious. This type of format command is normally used with dates and times. However, you are
counting hours. Excel uses a decimal date format where the integers are the days and the decimal part is the time.
e.g. 40939.36875 represents day 40939 (31/1/2012) and the time is 0.36875 (8:51am).
If you show this value using the
Format command with "h:n" format you will only see the decimal part (8:51am).
You could try dropping the format command. I would propose :
Another place to look is here:
If I understand correctly, Textbox10 contains the number of stop days. You want the total number of hours. However, you are subtracting the stop days. You could try:
Lastly, for TextBox10, you have the code
Consider this. Format(72,"d") = 12. Again, Excel thinks you want to know what day of the month, not how many days. So, if you go past 31 stop days, your code will break down (as it will role over to February). In general, I think none of your results should have Format commands in them.
If you're still struggling, please upload the file so we can see exactly what you are trying to do.
Hope some of this helps.
Cheers, Rob.
Bookmarks