Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Excel 2000
Windows 2k Pro I have a column of time values in a dbf file from a GPS unit. The time values are in military time format, i.e. "16:34:27" and they are written to the dbf as string values. I'm having a hard time figuring out how to do simple subtraction with them. Should I store them as String values or as Variants? I've tried both with little success. Any help greatly appreciated. Thanks! -gk- |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You could store them as Date... Subtraction can be performed on Dates and
you can do date/time formatting with it too. Sub test() Dim dtm1 As Date, dtm2 As Date dtm1 = CDate("12:30:00") dtm2 = CDate("16:34:27") MsgBox Format(dtm2 - dtm1, "hh:mm:ss") End Sub -- Rob van Gelder - http://www.vangelder.co.nz/excel "TBA" wrote in message ... Excel 2000 Windows 2k Pro I have a column of time values in a dbf file from a GPS unit. The time values are in military time format, i.e. "16:34:27" and they are written to the dbf as string values. I'm having a hard time figuring out how to do simple subtraction with them. Should I store them as String values or as Variants? I've tried both with little success. Any help greatly appreciated. Thanks! -gk- |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Subtracting Time | Excel Discussion (Misc queries) | |||
Subtracting a duration from a time to calculate a time. | Excel Discussion (Misc queries) | |||
Subtracting Dates to get total time work time excluding weekends | Excel Discussion (Misc queries) | |||
SUBTRACTING TIME VALUES INSTEAD OF DECIMAL!! | Excel Discussion (Misc queries) |