View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Rob van Gelder Rob van Gelder is offline
external usenet poster
 
Posts: 37
Default minutes & seconds functions

Sub test()
Debug.Print Minute("00:22:42")
Debug.Print Second("00:13:01")
End Sub

note that 22:42 would be interpreted as 10pm, not 22 minutes.



On 13-Dec-2009 16:54, Robert Crandal wrote:
Are there a family of functions related to "IsDate" which
extract minutes and seconds???

For example:

GetMinutes("22:42") == would return "22"
GetSeconds("13:01") == would return "01"


"Rob van Gelder" wrote in message
...
Use the IsDate function

However, you'll note that ":45" is not considered a valid date.

Sub test()
Debug.Print IsDate("1:22")
Debug.Print IsDate("0:22")
Debug.Print IsDate(":45")
Debug.Print IsDate("6a:20")
Debug.Print IsDate("hello")
End Sub

Cheers,
Rob