Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
is it possible to check the format of a time value (like hh:mm) without
having to use regular expressions. the numberformat function doest seem to be applicable to time |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try some code like the following:
Dim S1 As String Dim T As Date S1 = "12:34" On Error Resume Next T = TimeValue(S1) If Err.Number = 0 Then Debug.Print "valid time" Else Debug.Print "Not a valid time" End If -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "phil" wrote in message ... is it possible to check the format of a time value (like hh:mm) without having to use regular expressions. the numberformat function doest seem to be applicable to time |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am not 100% sure what you mean? If I run this code with Cell A1 foramtted
"hh:mm", it seems to work... -- HTH... Jim Thomlinson "phil" wrote: is it possible to check the format of a time value (like hh:mm) without having to use regular expressions. the numberformat function doest seem to be applicable to time |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I meant this code... The intricacies of Cut and Paste is lost on me today...
MsgBox Range("A1").NumberFormat -- HTH... Jim Thomlinson "Jim Thomlinson" wrote: I am not 100% sure what you mean? If I run this code with Cell A1 foramtted "hh:mm", it seems to work... -- HTH... Jim Thomlinson "phil" wrote: is it possible to check the format of a time value (like hh:mm) without having to use regular expressions. the numberformat function doest seem to be applicable to time |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Time calculations for Scheduled Time vs. Actual Time Worked | Excel Discussion (Misc queries) | |||
straight time, time and a half, and double time | Excel Discussion (Misc queries) | |||
Calculate Ending time using Start Time and Elapsed Time | Excel Worksheet Functions | |||
Formula to find Stop Time from Start Time and Total Minutes | Excel Worksheet Functions | |||
Calculating days & time left from start date/time to end date/time | Excel Worksheet Functions |