Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

While reading Excel file, time value eg 00:30 display me 2.0833333E-02

Status
Not open for further replies.

Som76

Programmer
Jun 25, 2003
50
IN
While reading Excel file, if a cell has time value for eg 00:30, it display me 2.08333333333333E-02 instead of actual time value.
01:30 display 0.0625. and so on. All the time are displayed as decimal value instead of the proper time.
Please help.

Regards
Somu
 
Format you cell in the time format. This will give you the correct layout
 
CDate(0.0625) will show 1:30 (subject to your locale settings)

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'If we're supposed to work in Hex, why have we only got A fingers?'
 
Thank you for the suggestions.

Dyarwood, I cannot have the option to format the sheet, since the xlsheets are output of a separate application from another organisation. I am developing a application to transfer these excel sheets to our company Dataware house. The transfer work will be done by normal data entry operator and more likely the operator will not have rights to edit the sheets. So thats the problem that I cannot ask to format each sheet. And the other problem is there will be huge amount of sheets from different organisations. Format each sheet will be very hectic.

John, what u said is ok, but if i use this i cannot distinguish if 0.0625 is for Time or its a normal read. My excel sheet has normal readings as well in decimals. its difficult to differentiate which readings i will say CDate and which one i have to take as it is. :( thats my problem

Thanks for your all efforts. I also trying to find a way out.

Somu
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top