Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() how can i know a value of specific cell is time or not using macro? by the way, vartype(cel) ?? then number or time all result = 5 i want to get a time cell only. *** Sent via Developersdex http://www.developersdex.com *** |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Dim v as variant, s as string v = cell.value VarType(v) time, a decimal between 0-1 : returns 5 / vbDouble date, integer : returns 7 / vbDate date and time, decimal greater than 1 : returns 7 / vbDate s = activecell.numberformat So if you have a double between 0-1, and the numberformat includes characters associated with time format, eg "h", there's a strong possibility you've got a time. But not conclusive. Regards, Peter T "x taol" wrote in message ... how can i know a value of specific cell is time or not using macro? by the way, vartype(cel) ?? then number or time all result = 5 i want to get a time cell only. *** Sent via Developersdex http://www.developersdex.com *** |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
check spelling as you type | New Users to Excel | |||
Check for error.type in same cell | Excel Worksheet Functions | |||
how to check that a var type date is initialized ?? | Excel Programming | |||
userform-check data type | Excel Programming | |||
How to check a Variant for its data type | Excel Programming |