Results 1 to 4 of 4

Thread: Export Time Value to Excel comes in as decimal?

Hybrid View

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2004
    Posts
    308

    Export Time Value to Excel comes in as decimal?

    Hey chaps ?

    Trying to export a time value to Excel from MSAccess, Excel sees the value and displays it as a decimal ? I want to raw-export to show the time e.g; 13:45

    Any help out there ?

    Thanks

    Chubby..

  2. #2
    Lively Member
    Join Date
    Aug 2005
    Posts
    77

    Re: Export Time Value to Excel comes in as decimal?

    set the property of the cell to time
    VB Code:
    1. Selection.NumberFormat = "hh:mm;@"

    Pieter

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2004
    Posts
    308

    Re: Export Time Value to Excel comes in as decimal?

    Quote Originally Posted by [Pieter]
    set the property of the cell to time
    VB Code:
    1. Selection.NumberFormat = "hh:mm;@"

    Pieter
    Thanks for the post

    This export is for a customer who wants the raw data to compare against and short of VBA-coding the newly created Excel sheet's colum formatting (alot of work for such a small thing), I wont be able to set the format. No amount of formatting seems to make a difference from the Access end either ...

    thanks

    Chubby..

  4. #4
    Lively Member
    Join Date
    Aug 2005
    Posts
    77

    Re: Export Time Value to Excel comes in as decimal?

    You can use the format function
    VB Code:
    1. Dim s As String
    2. s = Format(your_time, "hh:mm")

    Pieter

Posting Permissions

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



Click Here to Expand Forum to Full Width