title: VBA convert time
body: <p>I need to convert time from 14:54 to a double 14+54/60. And i do this with the following code:</p>
  
  <pre><code>Private Function Omzetten(ByVal time As String) As Double
  Dim min As Integer, hours As Integer, datum As Date
  datum = CDate(time)
  min = DatePart("n", datum)
  hours = DatePart("h", datum)
  Omzetten = hours + min / 60
  End Function
  </code></pre>
  
  <p>But when the time is 26:00 he only gives 2 because 26-24 is 2. So I thought to ad day = DatePart("d", datum), but then he always gives day = 30. Does anyone has a solution?</p>