Excel Naar Tijd
Sub NaarTijd()
'
' NaarTijd Macro
' De macro is opgenomen op 13-10-2004 door Bas.
'
' Sneltoets: CTRL+t
'
sTekst = ActiveCell.FormulaR1C1
iPunt = InStr(1, sTekst, ".")
If IsNull(iPunt) Or Val(sTekst) < 0.01 Or Val(sTekst) > 1000 Then
MsgBox "Ongeldige tijd"
Else
If iPunt > 0 Then
sTijd = "=" & Left(sTekst, iPunt - 1) & "+" & Left(Right(sTekst, Len(sTekst) - iPunt) + "0", 2) & "/60"
ActiveCell.FormulaR1C1 = sTijd
End If
End If
End Sub

