SHARE
TWEET

Untitled

a guest Jun 19th, 2017 48 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 'Parses format HHH:MM.SS to an integer of seconds
  2. Function PARSETIME(timeStr As String) As Integer
  3.     PARSETIME = 0
  4.    
  5.     Dim hour As Integer
  6.     Dim min As Integer
  7.     Dim sec As Integer
  8.     Dim timeComp() As String
  9.    
  10.     If timeStr <> "" Then
  11.         timeComp = Split(timeStr, ":")
  12.         hour = timeComp(0)
  13.         timeComp = Split(timeComp(1), ".")
  14.         min = timeComp(0)
  15.         sec = timeComp(1)
  16.            
  17.         PARSETIME = sec + 60 * min + 3600 * hour
  18.     End If
  19.    
  20. End Function
RAW Paste Data
Top