Results 1 to 2 of 2

Thread: *resolved* Excel VBA - best variable to store time

  1. #1
    Addicted Member
    Join Date
    May 04
    Location
    Right here
    Posts
    185

    *resolved* Excel VBA - best variable to store time

    I'm trying to store a time stamp from a worksheet in a variable but I don't know the best type. The time stamp goes down to the second (I think) so for instance 00:40:49 is 0.028344907 in a cell that is in General number format. However regardless of whether or not the time stamp is actually to the second I have to be able to store the full decimal in the variable.

    Am I best storing the value in a double precision variable? Would this give me the resolution I need?

    Thanks
    -Rob
    Last edited by TheRobster; Aug 17th, 2012 at 06:00 AM. Reason: resolved
    http://www.sudsolutions.com

  2. #2
    PowerPoster
    Join Date
    Dec 04
    Posts
    18,526

    Re: Excel VBA - best variable to store time

    date type
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •