Hello All,
<table style="width: 511px; height: 151px;" border="0" cellpadding="0" cellspacing="0"><col style="mso-width-source:userset;mso-width-alt:4608;width:95pt" width="126"> <col style="mso-width-source:userset;mso-width-alt:3949;width:81pt" width="108"> <col style="mso-width-source:userset;mso-width-alt:4717;width:97pt" width="129"> <tbody><tr style="mso-height-source:userset;height:37.5pt" height="50"> <td class="xl64" style="height:37.5pt;width:95pt" height="50" width="126">Ticket
Start Time</td> <td class="xl63" style="border-left:none;width:81pt" width="108">Ticket
End Time</td> <td class="xl63" style="border-left:none;width:97pt" width="129">MTTR</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl68" style="height:15.0pt" height="20">13/08/2011 10:26</td> <td class="xl66" style="border-top:none">09/08/2011 03:38</td> <td class="xl67" style="border-top:none">27:20:25</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl65" style="height:15.0pt" height="20">08/08/2011 08:24:00</td> <td class="xl66" style="border-top:none;border-left:none">08/08/2011 09:15</td> <td class="xl67" style="border-top:none;border-left:none">149:22:36</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl65" style="height:15.0pt;border-top:none" height="20">08/08/2011 09:01:00</td> <td class="xl66" style="border-top:none;border-left:none">08/08/2011 11:51</td> <td class="xl67" style="border-top:none;border-left:none">148:45:36</td> </tr> </tbody></table>I have written few code for converting hh:mm:ss into mins, but its not happening.
For i = 2 To 20
Range("K" & i).Select
cycle = ActiveCell.Value
HourTime = "=Hour(" & cycle & ")*60"
HourTime = HourTime + "+(Minute(" & cycle & "))"
HourTime = HourTime + "+(Second(" & cycle & "))/ (60)"
ActiveCell.FormulaR1C1 = HourTime
Next i
Once i run the code, I'm getting wrong answer. Please help me.
<table style="width: 511px; height: 151px;" border="0" cellpadding="0" cellspacing="0"><col style="mso-width-source:userset;mso-width-alt:4608;width:95pt" width="126"> <col style="mso-width-source:userset;mso-width-alt:3949;width:81pt" width="108"> <col style="mso-width-source:userset;mso-width-alt:4717;width:97pt" width="129"> <tbody><tr style="mso-height-source:userset;height:37.5pt" height="50"> <td class="xl64" style="height:37.5pt;width:95pt" height="50" width="126">Ticket
Start Time</td> <td class="xl63" style="border-left:none;width:81pt" width="108">Ticket
End Time</td> <td class="xl63" style="border-left:none;width:97pt" width="129">MTTR</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl68" style="height:15.0pt" height="20">13/08/2011 10:26</td> <td class="xl66" style="border-top:none">09/08/2011 03:38</td> <td class="xl67" style="border-top:none">27:20:25</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl65" style="height:15.0pt" height="20">08/08/2011 08:24:00</td> <td class="xl66" style="border-top:none;border-left:none">08/08/2011 09:15</td> <td class="xl67" style="border-top:none;border-left:none">149:22:36</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl65" style="height:15.0pt;border-top:none" height="20">08/08/2011 09:01:00</td> <td class="xl66" style="border-top:none;border-left:none">08/08/2011 11:51</td> <td class="xl67" style="border-top:none;border-left:none">148:45:36</td> </tr> </tbody></table>I have written few code for converting hh:mm:ss into mins, but its not happening.
For i = 2 To 20
Range("K" & i).Select
cycle = ActiveCell.Value
HourTime = "=Hour(" & cycle & ")*60"
HourTime = HourTime + "+(Minute(" & cycle & "))"
HourTime = HourTime + "+(Second(" & cycle & "))/ (60)"
ActiveCell.FormulaR1C1 = HourTime
Next i
Once i run the code, I'm getting wrong answer. Please help me.