LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default calculating with timestamps in format hh:mm:ss.000 in EXCEL VBA

I'm trying to read a variable from an excel sheet in the format
hh:mm:ss.000 and subtract it with a value in the same format.
This works fine if i do it in the worksheet,


A1 = 09:03:00.296
A2 = 09:03:00.203

A2 - A1 = 00:00:00.093


however if i do the same in VBA im getting a "type mismatch" error 13

Dim A1
Dim A2

A1 = Worksheets("Sheet 1").Range("A1")
A2 = Worksheets("Sheet 1").Range("A2")

Worksheets("Sheet 1").Range("A3") = A1 - A2

I appreciate any help on this.

Thomas Meixner
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel calcutions using date/timestamps ghl Excel Discussion (Misc queries) 1 April 14th 10 07:06 PM
How to decode integer timestamps? Ron West Excel Worksheet Functions 8 November 19th 08 05:51 PM
calculating time, overtime in excel [h]:mm format iamtaranicole Excel Discussion (Misc queries) 4 November 9th 07 05:19 PM
Excel function to find difference of timestamps in milliseconds? Srikanth Excel Discussion (Misc queries) 1 July 6th 06 08:02 AM
timestamps in excel Chuck Cusack Excel Discussion (Misc queries) 4 January 24th 06 06:12 AM


All times are GMT +1. The time now is 01:40 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"