View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
NoodNutt[_2_] NoodNutt[_2_] is offline
external usenet poster
 
Posts: 39
Default Converting Numeral to Time equivalent

Hi Claus

I just rang you. It went to message.

I just noticed an alteration you made earlier and made the same change. I converts the number to time, but it is not the correct time. LOL

Entering 515 returns:- 12360:00 ( the formula bar has this: 29/05/1901 12:00:00 AM )

This is exactly what was happening to me prior:

When I used the following in helper cells I got the this:

Cell B2: 515
Cell B3: I use: =B2/100 This gives me: (5.15)
Cell B4: I use: =LEFT(B3,FIND(".",B3)-1) This gives me: (5___)
Cell B5: I use: =MOD(B3,100) This gives me: (___15)
Cell B6: I use: = B4&":"&B5 to arrive at this: (5:15)

So,. I tried the following which, of course failed to fire.. lol

Case 10
Target.Offset(0, 20).FormulaR1C1 = "RC10/100"
Target.Offset(0, 21).FormulaR1C1 = "Left(RC10, Find(""."", RC10) - 1)"
Target.Offset(0, 22).FormulaR1C1 = "=MOD(RC10,100)"
Target = Target.Offset(0, 21).Value & ":" & Target.Offset(0, 22).Value
Target.NumberFormat = "[h]:mm"
Target.Offset(0, 1).Select
Case 11
Target.Offset(0, 23).FormulaR1C1 = "RC10/100"
Target.Offset(0, 24).FormulaR1C1 = "Left(RC10, Find(""."", RC10) - 1)"
Target.Offset(0, 25).FormulaR1C1 = "=MOD(RC10,100)"
Target = Target.Offset(0, 24).Value & ":" & Target.Offset(0, 25).Value
Target.NumberFormat = "[h]:mm"

Cheers
Mark.