View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ron Rosenfeld[_2_] Ron Rosenfeld[_2_] is offline
external usenet poster
 
Posts: 1,045
Default Text Dates/times to d:hh:mm:ss

On Tue, 21 May 2013 19:01:07 -0400, Ron Rosenfeld wrote:

One minor change: if there are any characters preceding the first number in the string, the UDF will not return anything. A simple fix would be to change .Pattern to:

..Pattern = "\D*(\d+(?=\s*d\w*))?\D*(\d+(?=\s*h\w*))?\D*(\d+(? =\s*m\w*))?\D*(\d+(?=\s*s\w*))?"