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: 26
Default Time Format in VBA doesn't match Excel display

So far I've only tested this in Excel 2000, but a final solution would have
to work in Excel 2003 as well.

I'm reading data from cells in an Excel sheet and using the data to
construct ascii text files. The particular problem I have is this:
The cell I'm reading displays as "113:00:00" in Excel
The format of the cell is Category - Time, Type - 37:30:55 (and the sample
area shows "113:00:00" at this point.
The formula bar shows "1/14/1900 5:00:00 PM"
When reading the cell in my VB program, the raw value of the cell is
"4.70833333333333"
The NumberFormat property of the cell is "[h]:mm:ss"
When I read the cell with this number format (using the Format function), I
get the string ":01:00". The user would expect to see "113:00:00", which
Excel shows him is there.

How can I get the value that Excel is displaying, since using NumberFormat
doesn't work? (I know I could just tell the users to use straight text or
General format, but I would like to accommodate the users' desire to use
Excel formats to make their work easier.)
--
In theory, there is no difference between theory and practice; in practice,
there is.
 
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 Formula Bar Time Display Format TanMan Excel Discussion (Misc queries) 2 December 3rd 09 02:59 AM
display time in 12 hour format jatman Excel Worksheet Functions 1 March 20th 08 06:10 AM
Display time format Shane Excel Discussion (Misc queries) 1 July 24th 07 03:37 AM
How do I display time in a negative format? PCERM Excel Worksheet Functions 3 December 28th 05 01:58 PM
display no seconds in time format [h] Finolac Excel Discussion (Misc queries) 1 October 3rd 05 03:19 PM


All times are GMT +1. The time now is 01:38 PM.

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"