
Signature
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Greg Maxey - Word MVP
My web site http://gregmaxey.mvps.org
Word MVP web site http://word.mvps.org
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> =A1*24 and format as General.
>
[quoted text clipped - 17 lines]
>> Word MVP web site http://word.mvps.org
>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
With regard to resetting values to 8:00 and 16:00, try this code :
Sub time_reset()
n = Cells(Rows.Count, 1).End(xlUp).Row
For i = 2 To n
Cells(i, 1) = #8:00:00 AM#
Cells(i, 2) = #4:00:00 PM#
Next
End Sub
It simply fills the used portions of columns A & B with the desired reset
values.
Starting with an empty column that has been formatted to Text, enter values
like:
0534
0811
1130
without any colons and then select the cells and then run:
Sub time_converter()
For Each r In Selection
v = r.Value
hrs = Left(v, 2)
mins = Right(v, 2)
r.Value = TimeSerial(hrs, mins, 0)
r.NumberFormat = "h:mm;@"
Next
End Sub

Signature
Gary''s Student - gsnu200774
> Gary,
>
[quoted text clipped - 66 lines]
> >> Word MVP web site http://word.mvps.org
> >> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Greg Maxey - 19 Mar 2008 22:32 GMT
Gary,
Thanks for the code. I modified is slightly so that it doesn't effect the
row for Saturday which is normally not a workday and set at 0:00. It works
perfectly.
However, I am still seeing the odd value in Cell D8. When I reset the
values D8 reads "16:00" while D9 reads "40:00"
Again. D8 uses a formula =Sum(D2:D7) and the formula in D9 is =(D8*24).
The value in D2, D3, D4, D5, and D6 is "8:00" the value in D7 is "0"00"
How can D8 read "16:00" if is the sum of 8:00+8:00+8:00+8:00+8:00 ??
How can D9 read "40:00" if it is the sum of 16:00*24 ??

Signature
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Greg Maxey - Word MVP
My web site http://gregmaxey.mvps.org
Word MVP web site http://word.mvps.org
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> With regard to resetting values to 8:00 and 16:00, try this code :
>
[quoted text clipped - 107 lines]
>> >> Word MVP web site http://word.mvps.org
>> >> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Gary''s Student - 20 Mar 2008 00:33 GMT
There are several things to check:
1. compare the formats of the cells that are correct to the cells (like D8)
that are not correct. It might just a formatting issue.
2. Insure that D2 thru D7 are genuine numbers. SUM() ignores non-numbers
and won't even tell you.
If worst come to worst, select D2 thru D8 and change the format to General.
It will then be easier to check the math!!
Update this post if problem persist.

Signature
Gary''s Student - gsnu200774
> Gary,
>
[quoted text clipped - 124 lines]
> >> >> Word MVP web site http://word.mvps.org
> >> >> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Greg Maxey - 20 Mar 2008 00:56 GMT
Gary,
Thanks.
I think I have it sorted out and understand what was going on. When I
chagned D8 to General it's value changed to 1.666667. I realized that 40
hours is 1.666667 days and apparently the format I was using for that cell
made 1.666667 days looke like 16 hours.

Signature
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Greg Maxey - Word MVP
My web site http://gregmaxey.mvps.org
Word MVP web site http://word.mvps.org
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> There are several things to check:
>
[quoted text clipped - 160 lines]
>>>>>> Word MVP web site http://word.mvps.org
>>>>>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~